jmilane Posted September 20, 2006 Share Posted September 20, 2006 Hi,I have a mysql box that has a private network ip. The old developer wasrunning our web server on this machine but the company since retiredthe box and it is in a closet, still running, but sad and alone,aliased as oldserver.mycompany.com.Now I am finding out that I need to use some of the funcitonality inthe scripts that are on the old box.So, I just installed PHP on our new IIS webserver I have a form that he built which collects information from potentialclients and then passes it on for entry in the database (on the oldbox), sends out emails, does calculations, and so on and so forth. Itdoes a lot, actually.I cannot build a form to pass directly to this mysql box because itdoes not have a public IP. I cannot submit directly to a private IP.Found this out recently.So I tried to do something with cURL:[code]$ch = curl_init("http://oldserver.mycompany.com/somepage.php");curl_setopt($ch, CURLOPT_POST); //use the POST methodcurl_setopt($ch, CURLOPT_POSTFIELDS, $_POST); //take the $_POST arrayand use those as the POST parameters for the curl requestcurl_exec($ch); //execute the request [/code]But now I find out that CURLOPT_POSTFIELDS wants a string.Some of my $_POST variables are arrays. I think one is even an array of arrays. So now I have a new question...How can I go through $_POST and serialize() it, (is this even what I want to do??) and create a string that I can use with CURLOPT_POSTFIELDS?Mind you, I have been using PHP for a month If I am way off base, I sincerely apologize.I am also sincerely grateful for your time. I have been banging my head against the wall with this. Oh yeah... does PHP need to have cURL enabled on the machine that receives this request?Thanks a million... really... I feel awful asking this compound question.J Quote Link to comment https://forums.phpfreaks.com/topic/21386-curl-help-needed-in-over-my-little-head/ Share on other sites More sharing options...
HuggieBear Posted September 20, 2006 Share Posted September 20, 2006 Seems like a stupid question, but the old box is still serving pages on http://oldserver.mycompany.com/ across the LAN isn't it ;)RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21386-curl-help-needed-in-over-my-little-head/#findComment-95206 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.