Is it possible to POST data from PHP scripts?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
calmness
Forum Newbie
Posts: 6
Joined: Fri May 23, 2003 8:51 am
Location: Kiev, Ukraine
Contact:

Is it possible to POST data from PHP scripts?

Post by calmness »

I need to pass data to several scripts in the Internet by method POST. The data for fields is retreived from the database and this operation must repeat several times. Is it possible to do from PHP code (without generating HTML forms)?
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

Maybe with header("Location: test.php?foo=bar"); ?

Or is that not the type of solution u need.
User avatar
calmness
Forum Newbie
Posts: 6
Joined: Fri May 23, 2003 8:51 am
Location: Kiev, Ukraine
Contact:

Post by calmness »

No, I don't need the GET passing.
I search the way to pass exactly by POST method, if it is possible ofcourse.
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

And parsing the $_POST variables into a session?

Code: Select all

session_start();
if(isset($_POST)){
  $_SESSION["post"] = $_POST
}
And then acces the $_POST with $_SESSION["post"] ?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

take a look at http://snoopy.sf.net
maybe it's useful for you.
User avatar
calmness
Forum Newbie
Posts: 6
Joined: Fri May 23, 2003 8:51 am
Location: Kiev, Ukraine
Contact:

Post by calmness »

Unfortunately these scripts (to which I pass the data) located on another server and the way with $_SESSION is not usable.
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

At the bottom of this link is some code I came up with

viewtopic.php?t=7063
User avatar
calmness
Forum Newbie
Posts: 6
Joined: Fri May 23, 2003 8:51 am
Location: Kiev, Ukraine
Contact:

Post by calmness »

Thanks a lot!
It seems to me this is what I looked for. :wink:
I'll try to do so.
Post Reply