Page 1 of 1

Communication of the backend via php

Posted: Thu Feb 23, 2006 9:21 am
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).

Posted: Thu Feb 23, 2006 10:13 am
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()

Posted: Fri Feb 24, 2006 1:20 am
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.

Posted: Fri Feb 24, 2006 2:26 am
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.

Thank you

Posted: Mon Mar 13, 2006 11:14 pm
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