473,802 Members | 2,026 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.mycom pany.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 1981

ad***@worstofbo ston.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.mycom pany.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.mycom pany.com/somepage.php");
curl_setopt($ch , CURLOPT_POST); //use the POST method
curl_setopt($ch , CURLOPT_POSTFIE LDS, $_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***@worstofbo ston.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.mycom pany.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.mycom pany.com/somepage.php");
curl_setopt($ch , CURLOPT_POST); //use the POST method
curl_setopt($ch , CURLOPT_POSTFIE LDS, $_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\m iddle.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\extra s' 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\m iddle.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\extra s' for
reading in Unknown on line 0
I have been told that CURLOPT_POSTFIE LDS 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***@worstofbo ston.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.PH P Warning: Cannot open 'C:\\Program Files\PHP\extra s' for
reading in Unknown on line 0


I have been told that CURLOPT_POSTFIE LDS 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*******@attgl obal.net
=============== ===
Sep 20 '06 #6

Jerry Stuckle wrote:
ad***@worstofbo ston.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\extra s' for
reading in Unknown on line 0

I have been told that CURLOPT_POSTFIE LDS 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_quer y()
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
17223
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 respectively, and send those fields and their values via POST to a PHP page. So these would be sent basically: $_POST which may equal "cow". $_POST which may equal "cat".
13
2439
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 these errors. I told him about the errors and we concluded that this was happening due to the computers in class running php 4.3.2 and my computer is running php 4.3.6. However I was told the way I solved the problem was uneligant code. He said I...
24
2886
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 image below it.
1
6995
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? NOTE: when i use $_GET the script just works. Thanks in advance for helping a noob.
9
2022
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 script is a simple html script, which calls a php script passing it the variables which it got by the forms: **************HTML doc. named "insert.htm"************************ <html> <head> <title>HTML Form</title>
3
2175
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 verification, and I want to bypass the verification, but I can't figure it out. Can anyone help. - I have pasted the script below. Many thanks, Jano <? include("header.php"); ?> <? // read the post from PayPal system and add 'cmd' $req =...
7
3367
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 based on the segments of the URI it will fire up some controller class, for instance, say I have an inbox in which end-users can view messages they got from other users, they'ld start at:
32
8214
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 database and I noticed that they are relaying on HTML form value names to always be lowercase in their code (ie $_POST (fyi that may be typed wrong)) and from my experience it is always better, when reading in the post information to convert the the...
1
3210
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 code for attachment, I am not able to send anything. I get blank email. Can you please help me on this? Here is the html form:
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10538
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
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 we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.