Jump to content

what does $_POST do?


rsammy

Recommended Posts

When you make form in (X)HTML like this :

[code]
<form metod="post" action="page.php">
<input name="b" type="text" />
</form>
[/code]

note the method in form tag :) it's post , so any "input" in this form will save in $_POST array .

try :
[code]print_r($_POST);[/code]

in page.php :)
Link to comment
https://forums.phpfreaks.com/topic/15179-what-does-_post-do/#findComment-61209
Share on other sites

POST is a method of passing data between scripts. Here's an example:
[code]<form name="test" action="next.php" method="POST">
<input type="name" name="name"/>
<input type="submit" name="submit" value="GO!"/>
</form>

//PHP page "next.php"
<?php
echo "Hello $_POST[name]";
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/15179-what-does-_post-do/#findComment-61211
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.