How to intersperse PHP with HTML again
Hi,
In my site, I have a "Make A Friend" link, which will lead to a page where the user has to input their username and password, to identify who they are. The link is like so: "makeafriendlogin.php?person=26", to identify the person who is going to *making* the friend. When the Submit button on the login page is clicked, the "person" argument has to be transmitted to the script that handles it (makefriend.php). This is how I'm going to lay out the "makeafriendlogin.php" script:
<form method="post" action="makefriend.php">
<input name="username" type="text>
<input name="password" type="password">
<?php
$person=$_POST['person'];
<input name="author" type="hidden" value="$person">
?>
<input type="submit" value="submit">
</form>
My probem is with the "<input name="author" type="hidden" value="$author">" line - unless I put it within <?php and ?> tags, the "$person" won't be parsed, but at the same time, it's HTML, not PHP.... so I can't figure out what to do. Should I put it in a "print" statement?
Can anyone help?
Apologies if it sounds like another thread of mine on the same topic, but I'm really getting confused about *this matter*.
Thanks.
|