Jump to content

Archived

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

rsammy

what does $_POST do?

Recommended Posts

not sure if this is the place to ask this question. im sorry if its the wrong place ???
ive tried lookin up for this with no success?

is it used to retrieve values from previous screen?

thanx

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.