Well, the title is somewhat self vague, but basically, I want to use a php echo to print the values of the variable of an html form. Php is installed on my system, but when I run the code the spaces where I put in a $variablename, the html and other text comes out, but it doesn't print the value of the variable. How can I fix this, or is there something I can do?
This is an example of the form source:
<form action="code.php" method=post>
<input type=text name="variable1" value="blue">
<input type=submit value="send">
</form>
This is the php code that I send the results of the above form:
<?php
echo "I like $variable1";
?>
If you know whats wrong, please help me.
printing php variables on html forms
Moderator: General Moderators
try

Code: Select all
<?php
echo "I like ".$_REQUESTї'variable1'];
?>- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK