I have a php page with the following:
echo "<form method='post'><input type='hidden' id='memberIdd' name='memberIdd' value=" . $memberId . "></form>";
Now I created another php page and want to grab the value of this hidden field and place it into another variable. How can I do this? I tried using this for my second php page:
$member = $_POST['memberIdd'];
But I just keep getting “undefined” for $member.
Thanks
http://www.w3.org/TR/html4/interact/forms.html#h-17.1
If you don’t write the
actionthen the posted data goes to the same page where you were.And by the way, the variable
$memberId(the one in your question) at thefirstpage.phpshould be defined. In other case it will prompt error message.Edit: It will better for you to use HTML codes out of PHP.