Jump to content


Photo

what does $_POST do?


  • Please log in to reply
3 replies to this topic

#1 rsammy

rsammy
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts

Posted 20 July 2006 - 06:06 PM

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

#2 MaaSTaaR

MaaSTaaR
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationKuwait

Posted 20 July 2006 - 06:13 PM

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

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

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

try :
print_r($_POST);

in page.php :)
Sorry for my bad English, it's not my mother language and I am still learning it :)

#3 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 20 July 2006 - 06:18 PM

POST is a method of passing data between scripts. Here's an example:
<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]";
?>


#4 rsammy

rsammy
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts

Posted 20 July 2006 - 11:04 PM

thanx guys




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users