I need some help with this form. I have a form on one page where someone can enter their email address to join a newsletter. Once they hit submit, it takes them to a 2nd page which asks if the address they entered was correct then submits it to a 3rd page which emails the email address and forwards them back to the site. Right now, everything is working except the 2nd page is not passing the email address entered to the 3rd page. Here is the code from the 2nd page <form method="post" action="join.php"> <?php $email_address = $_POST['email_address']; print "If $email_address is correct, please press the submit button below.<br><br>"; ?> <input type="submit" name="submit" value="Submit" /> </form> PHP:
You'll have to throw a hidden input in your form too containing the email address. Right now you don't have the email address anywhere in the form (besides that bit of text which won't get passed to the next page..). <input type="hidden" name="email_address" value="<?=$email_address?>" /> ^Put that right above your submit button. Don't need to put it in the PHP tags either with a print/echo in front of it since it still echos out the email address into the HTML with the <?=$email_address?> (which is shorthand for doing <?php echo $email_address; ?>)