views:

15

answers:

3

I have a web form on an IIS server (has no PHP). I have a PHP script on a LAMP server. My _POST var array is coming up empty on the LAMP server. My suspicion is I cannot pass POST vars from 1 server to another but I would like to have that confirmed. Does anyone know the answer to this?

If that's the case then I know I need to with use _GET vars in the URL's Query String or set a cookie (which I can do because both servers are config'd with the domain name).

Thanks for your help.

A: 

We'll you could receive the post in IIS and use ASP(.NET) to perform a POST to your PHP server which would then let you access the data. If you do go around the query string route just keep in mind that vast amounts of data won't always make it through.

Alistair
Interesting...Actually, my web form's action goes to an ASP script for brief form validation and then response redirects to my PHP script. Now the more I think about it, I'll bet the response redirect is trashing my POST vars
Dr. DOT
A: 

You can use ASP/ASP.NET or whatever you do have installed on the IIS server to call the other server. What you can do depends on the framework you go with, but it should be possible to send a POST.

For an ASP.NET explanation, see this: http://odetocode.com/articles/162.aspx

Oli
Might you know how to get the POST vars to the other server in ASP (using response redirect)?
Dr. DOT
You can't. To "transfer" POST you *need* your first server to send a request to your secondary server and you just can't do that with `response.redirect()` (because that just tells the user's browser to go to another server and does nothing with the data)
Oli
A: 

I overthought my first answer.

Why don't you just change the action url attribute on the <form> tag to the PHP script address you want to collect and process the form?

eg go from:

<form method="post">
    <input ...>
</form>

to:

<form method="post" action="http://other.server.ext/my-php-script.php"&gt;
    <input ...>
</form>
Oli
That's an option. I already wrote the form validation in ASP on the IIS server and rather than jumping back and forth between servers with validation and post-processing, etc., I have decided to just change my response redirect to tack on a query string containing the form contents (it's not a lot of data and ports quite nicely as I have already started down that path).Thanks for your help though Oli!I guess the answer to my original question is that you can pass _POST vars between servers. I just had something going on in between the servers...
Dr. DOT