|
Posted by admin on 09/20/06 02:20
ZeldorBlat wrote:
> admin@worstofboston.com wrote:
> > Hi,
> >
> > I have a mysql box that has a private network ip. The old developer was
> > running our web server on this machine but the company since retired
> > the 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 in
> > the 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 potential
> > clients and then passes it on for entry in the database (on the old
> > box), sends out emails, does calculations, and so on and so forth. It
> > does a lot, actually.
> >
> > I cannot build a form to pass directly to this mysql box because it
> > does not have a public IP. I cannot submit directly to a private IP.
> > Found this out recently.
> >
> > So I was thinking I could have the form submit to our web server, and
> > they my web server could in turn submit the $_POST variables to the
> > private box.
> >
> > This should work, no?
> >
> > My problem is, I need to create a file on my web server that will do
> > nothing but take the $_POST variables and hand them off to the private
> > box for processing.
> >
> > How can I take $_POST and repost it?
> >
> > It is probably not difficult, but I am new to PHP. I have looked,
> > cannot find the answer.
> >
> > I would not be able to press a button, so the submission would have to
> > be automatic.
> >
> > Is this possible?
> >
> > Can you help? I truly appreciate it. I need to get this up... as a
> > temporary solution... then I can try to duplicate the functionality on
> > the private box with the web server.
> >
> > All I want to do is take the $_POST variables from the form and pass
> > them to an intermediary script that is able to talk to the private box,
> > and then have that intermediary script pass them along again as a
> > $_POST array.
> >
> > Thanks a lot!!!!!!
> >
> > Frank
>
> Use the curl functions (http://www.php.net/curl). Here's how:
>
> $ch = curl_init("http://oldserver.mycompany.com/somepage.php");
> curl_setopt($ch, CURLOPT_POST); //use the POST method
> curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST); //take the $_POST array
> and use those as the POST parameters for the curl request
> curl_exec($ch); //execute the request
This is a great response. I really thank you for taking the time to
answer me.
Do both servers need to have curl enabled?
I am getting this error:
Warning: Wrong parameter count for curl_setopt() in D:\ULEM
WebSite\forms\middle.php on line 5 (This is the code above that you
wrote)
Message was not sent
Please tell the Administrator: Mailer Error: Could not instantiate mail
function.PHP Warning: Cannot open 'C:\\Program Files\PHP\extras' for
reading in Unknown on line 0
Navigation:
[Reply to this message]
|