ev66
05-15-2005, 03:40 AM
This may be a html prop,but think its php.
I'm trying to pass the value of a variable using the Form, Post method
but all i keep getting is the variable name and not its value.I know its something simple,but i,ve tried all variations of ' and " but cant get it to work.heres my code
page1
<body><?php
$mycol="red";
$dis='<form name="form1" method="post" action="login2.php">
<input name="hiddenField" type="hidden" value="$red">
<input type="submit" name="Submit" value="Submit">
</form>';
echo '<p>' . $dis . '<p>';
?>
</body>
page2
<body>
<?php
$mycol=$_POST['hiddenField'];
echo $mycol;
?>
this just echos $red and not red as i want it.
Thanks for your help
evan
I'm trying to pass the value of a variable using the Form, Post method
but all i keep getting is the variable name and not its value.I know its something simple,but i,ve tried all variations of ' and " but cant get it to work.heres my code
page1
<body><?php
$mycol="red";
$dis='<form name="form1" method="post" action="login2.php">
<input name="hiddenField" type="hidden" value="$red">
<input type="submit" name="Submit" value="Submit">
</form>';
echo '<p>' . $dis . '<p>';
?>
</body>
page2
<body>
<?php
$mycol=$_POST['hiddenField'];
echo $mycol;
?>
this just echos $red and not red as i want it.
Thanks for your help
evan