$_POST variable

The POST method used to send data to the server. The $_POST Variables contains information pertinent to any parameters passed using the POST method. In the POST method data is sent as standard input. POST is assumed more secure and we can send more data.

$_POST Example :


<form action="method_post.php" method="post">
<p>
Email address:
<br />
<input type="text" name="email" size="20" maxlength="60" value="" />
</p>
<p>
Password:
<br />
<input type="password" name="pswd" size="20" maxlength="15" value="" />
</p>
<p>
<input type="submit" name=" login" value="login" />
</p>
</form>

Here POST method is used to control the form values. When we submit button is clicked, the form data will be send to method_post.php file because this is the file name mentioned in the form action part.Form is submitted when the user clicks the "Submit" button, when PHP POST method is used then the URL will not contain any form data, the URL will be passed as such. Here URL will be

http://www.tutorialsscripts.com/method_post.php

Out Put :

Email : tutorialsscripts.com
Password: Post

Like $_GET, the $_POST variables is by default the only way to access POST variables. You cannot reference POST variables like this: $email, $pswd, and $subscribe.





Content