Communication of the backend via php

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
dorgon
Forum Newbie
Posts: 4
Joined: Wed Feb 22, 2006 8:35 am

Communication of the backend via php

Post by dorgon »

I have no ideas for following question, please tell me the solution. Wait for your helps!!!

Under the backend, how to edit the receive.php which will transfer parameters to following IP address(virtual) automatically while it get the info from gateway?

http://2.2.2.2/retrieve.php?sp=100&msg=ok

Assume following IP address (virtual) will not be opened by any browsers.

http://1.1.1.1/receive.php
And the backend of gateway will send php program the parameters $sp=100 and $msg=ok. The gateway will transfer them via POST with trigger. Meanwhile the receive.php will get data from gateway automatically, and insert them to MySQL...........

Remark:

1)the function header(sprintf(“location:%s”,$insertGoTo)); is not workable, and any methods of jumping are no execution for browser.

2)my goal is establish the connection between gateway and the IP address http://2.2.2.2/retrieve.php for exchange of the info.not means between IP addresses( http://1.1.1.1/receive.php and http://2.2.2.2/retrieve.php).
Last edited by dorgon on Fri Feb 24, 2006 12:59 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Let me see if I can get this straight. You want the server to make a hidden (from the user) post to a separate script that is not on the server the user requests the page from? Sounds like a job for cURL or fsockopen()
dorgon
Forum Newbie
Posts: 4
Joined: Wed Feb 22, 2006 8:35 am

Post by dorgon »

feyd wrote:Let me see if I can get this straight. You want the server to make a hidden (from the user) post to a separate script that is not on the server the user requests the page from? Sounds like a job for cURL or fsockopen()
Thanks for your solution.

the functions took them a try,but they were unworkable.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Was I even right for what you're wanting to do? If I am, you're fairly much out of choices as far as posting goes. With get requests, you'd have a few more options. file_get_contents() for instance.
dorgon
Forum Newbie
Posts: 4
Joined: Wed Feb 22, 2006 8:35 am

Thank you

Post by dorgon »

feyd wrote:Was I even right for what you're wanting to do? If I am, you're fairly much out of choices as far as posting goes. With get requests, you'd have a few more options. file_get_contents() for instance.
Thanks for your replies. I have got the solution as following:

fopen("http://2.2.2.2/retrieve.php?msg=000",”r”);
Actually, you offer the function fsockopen() is workable during initialization of web server. I have resolved some problems via you.

Anyway, thank your clues and hints so much.
:P
Post Reply