PHP variable in HTML
There are many times that you might like to use or include PHP variables within HTML codes, case like to use for a text box’s name, and the way to do so is:
Lets say you want to have a text box with name “namebox” and you want to use the PHP variable $textboxname to store the name, then you want to use the name for a HTML text field element:
1 2 3 4 | <?php $textboxname = namebox; ?> <input type="text" name="<?php echo $textboxname;?>"/> |
Don’t forget to included <?php and ?> to make it as a PHP statement.





Add A Comment