-1

I have a textBox where the user must fill his email, like this:

<td><input type="email" name="MAIL" value="foo@gmail.com" required></td>

And a submit button, where runs the following code when the user presses it:

if(isset($_POST['submit']))
{
    header("Location: page.php?email=".$_REQUEST["email"]."");
}

I was expecting that upon a submit click the following page was:

page.php?email=foo@gmail.com // What I should expect!

But I get always:

page.php?email=    //what I get...Wrong!

What is wrong here?

waas1919
  • 2,365
  • 7
  • 44
  • 76

1 Answers1

1

Look at your code. The name of the element is "MAIL" but you are pulling "email" from the REQUEST.

Try this:

<td><input type="email" name="MAIL" value="foo@gmail.com" required></td>

then

if(isset($_POST['submit']))
{
    header("Location: page.php?email=".$_REQUEST["MAIL"]."");
}