How to Hide Strings in PHP
PHP creates dynamic content for Web readers. Hide strings using the "hidden" input type, which lets you store string values without them showing up in the Web page's contents. Add the hidden field in HTML format, but use the PHP coding technique to store the hidden string on the page.
Instructions
-
-
1
Right-click the PHP page you want to edit and select "Open With." Double-click the PHP editor you want to use to add the hidden fields.
-
2
Create the hidden field. Add the following code to your HTML form in the PHP page:
<input type="hidden" name="hidden_string" value="">
This code adds a hidden field named "hidden_string." You add the PHP code within the "value" quotes.
-
-
3
Add your PHP string to the hidden field. For instance, add the following code to the hidden field's value property to store the string "hello, world":
<?php print "hello, world"?>
-
1