Forum Moderators: coopster
I'm trying to embed a hidden variable 'username' in a form, but the form is generated by php echo.
This isn't working at the moment, could anyone tell me how to format the $_SESSION["username"] bit please?
At the moment it prints " /> and I lose the variable.
<?php
echo '<form action="formt.php" method="post">
<input type="hidden" name="uname" value="$_SESSION["username"]" />
<input type="submit" label="submit"></form>';
?>
Thanks
;)
PHP variables arent parsed if they are done echo within single quotes, you dont need to enclose them however you can use doulbe quotes for that