473,511 Members | 14,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help with $_POST variables

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

Sep 19 '06 #1
6 1967

ad***@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

Sep 19 '06 #2
I know nothing about cURL

guess Ill have to learn

thanks...

Sep 19 '06 #3

ZeldorBlat wrote:
ad***@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

Sep 20 '06 #4
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
I have been told that CURLOPT_POSTFIELDS expects a string, so $_POST
will not work??? It also happens that many elements of my $_POST array
are arrays...

I am in over my head here...

I apologize for all the questions...

Sep 20 '06 #5
ad***@worstofboston.com wrote:
>>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


I have been told that CURLOPT_POSTFIELDS expects a string, so $_POST
will not work??? It also happens that many elements of my $_POST array
are arrays...

I am in over my head here...

I apologize for all the questions...
No, you can't use arrays - but then you can't send a PHP array in a
header, anyway. You'll have to parse your $_POST array out into id/value
pairs, just like you would see in a GET with parameters.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 20 '06 #6

Jerry Stuckle wrote:
ad***@worstofboston.com wrote:
>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

I have been told that CURLOPT_POSTFIELDS expects a string, so $_POST
will not work??? It also happens that many elements of my $_POST array
are arrays...

I am in over my head here...

I apologize for all the questions...

No, you can't use arrays - but then you can't send a PHP array in a
header, anyway. You'll have to parse your $_POST array out into id/value
pairs, just like you would see in a GET with parameters.
It depends on which version of PHP and curl you are using. Some will
let you just give it an array. You can always use http_build_query()
to make the conversion easy:

http://www.php.net/http_build_query

Sep 20 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17212
by: Sugapablo | last post by:
I have a dynamic form that that creates input variables named different things based on what it reads from the database. So, for example, it may create three fields, named ex12, ex23, and ex45...
13
2412
by: Robert Smith | last post by:
I'm doing a website development course and during an exercise my teacher gave me to do at home I was confronted with errors. Surprisingly, those that did the exercise in class did not receive...
24
2859
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
1
6985
by: RDizzle | last post by:
okay. so all i am doing is changing a registration script that uses $_GET to a script that uses $_POST, but the validation script now returns NULL values for all posted vars. What's the deal? ...
9
2007
by: lovinlazio9 | last post by:
I've just started messing around with PHP and believe it or not its extremely frustrating haha. Anyway, I wanted to make a simple input form that would display the info after submitting it... The...
3
2156
by: Jano | last post by:
Hi - Happy New Year! I have a web-site which accepted paypal payment for membership. No-one's buying so I want to make it free. The page which inputs the member details into the database needs...
7
3353
by: amygdala | last post by:
Hi all, I'm starting this new project in which I'ld like to implement sort of a design pattern I have seen being used in the CodeIgniter framework. Basically, the site will examine the URI and...
32
8132
by: Bill H | last post by:
I wouldn't consider myself a newbie to PHP since I have never written one line of code in it (am a perl guy myself), but part of a team I am working with is writing some php interfaces into a...
1
3191
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.