Page 1 of 1

Reading remote pages via HTTP by sending a POST request

Posted: Tue May 13, 2003 12:33 pm
by Patricia Saura
Hi@all!

I am looking for a solution to the following:
For posting automatically in a forum I have to send information via a POST request to that forum. But I don't know how to do this. I have just recently tested reading a remote location without this POST stuff. (fopen, fgets, fclose)
Do you know any way to do this?
And maybe, you even know a way to fetch the cookie sent by the forum, so I could login with my regular ID and would not have to post anonymously...

Thanx a lot.
Greeting.
Patricia

Posted: Tue May 13, 2003 12:57 pm
by Jim
If I understand your problem, using $_POST['information_you_want']; should work.

To read a cookie as a username, this should do:

$username = $_COOKIE['cookie_name'];

I may be misunderstanding your question though.

Posted: Tue May 13, 2003 1:20 pm
by Patricia Saura
Yes, I think you are misunderstanding my question.

I'm not sending any POST-Info to my own script. There is a forum outside my server. Just like this one here. And I need to access this forum through my own PHP script. But therefore I need to send information to the forum (always from within PHP) just like a browser would, if I told him to "method=post" something to the forum.

Only, I do not want to add posts manually cause I'm starting to run a virtual company in a virtual nation dealing with bets. And these bets have to be communicated somehow. Well, as i'm not going to spam anyone, I thought of automatically posting my actions in the forum. (Besides, my free server doesn't support sendmail yet.) But unfortunately, I'm no admin of the forum server. :-) So it gets kind of problematic. At least for me. Therefore, I tried my luck in this forum. (Because, if you dont know anything...)

I hope my question got a bit more clear now.
It's the same with that cookie thing: Of course I have an account in the forum. It would be a bit more professional to post using that account. Because it appears slightly different from anonymous posts. :-) But it is not really necessary.
Necessary it (cookie thing) is for automatically transfer the won amounts of virtual money. And in the nearer future I really would like to handle this by a script too. Because it will get kind of annoying work to always transfer this by hand... :-)

Greetings.
Patricia

Posted: Tue May 13, 2003 3:25 pm
by volka

Great! Thanks

Posted: Wed May 14, 2003 2:35 pm
by Patricia Saura
That was exactly what I needed...
Thanks a lot.

Greeting.
Patricia