0

i want to POST variable using following url example:

<form method="POST" action="index.php?p=1">
    <input id="mail" type="text" size="50" placeholder="E-Mail" />
    <input id="password" type="password" size="50" placeholder="Password" />
    <button type="submit">Login</button>
</form>

With the p-Variable in the link my site determine which default site should be shown.

My problem is that no data is available in the $_POST array in my default site.

Is it possible that the $_POST-data is only available for the next script that is called?

Or what am I doing wrong?

3
  • I don't understand the question. Commented Sep 17, 2014 at 21:01
  • 3
    Try with name attribute Commented Sep 17, 2014 at 21:02
  • Basic HTML can be hard. Commented Sep 17, 2014 at 21:09

1 Answer 1

1

You need to name the inputs. For example name="mail":

<form method="POST" action="index.php?p=1">
    <input name="mail" id="mail" type="text" size="50" placeholder="E-Mail" />

Then you would access $_GET['p'] and $_POST['mail'].

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.