Jump to content

Archived

This topic is now archived and is closed to further replies.

chaseb

Simple PHP Post to another script.... I must be retarded

Recommended Posts

I am sorry, I just can't figure this out, but I know that it must be very simple.  So, please help before I jab my eyes out! 

I have a php file, test.php, and I want to send a simple post to another php file on other server, and get a return.  So something this.

Call test.php > auto post www.mydomain.com/test2.php?myVar=200 > return from www.mydomain.com/test2.php to test.php return=true > test.php returns return=true

Thanks for any help!

Share this post


Link to post
Share on other sites
set the action of the form to the file you want to process the form. that's really all there is to it.

Share this post


Link to post
Share on other sites
Not entirely sure what you want here, but you can use CURL to load another script from within your own - that can entirely simulate posting the form itself - the output from the first script could in itself be a return with this method, assuming you can customise both scripts.

You might be wanting to include the second script. If this is the case, you can use functions from the second script, but all returns need passing through an array: return $whatever.

Third option, if you're wanting to just bounce a user backwards and forwards between scripts, you could just use a simple refer?

Share this post


Link to post
Share on other sites
sorry if my post was a bit confusing.  What I want to be able to to do, is call server1.com/test1.php from Flash, then have server1.com/test1.php do a call to server2.com/test2.php  to post just one variable, then get server2.com/test2.php 's response and have server1.com/test1.php return that to flash. 

Share this post


Link to post
Share on other sites
no, just talking to a php script, no remoting involved - which is primarily focused on SOAP/Java/.Net based apps not PHP

Share this post


Link to post
Share on other sites
I am doing some testing now, and I just need to ask, PHP security domain permissions allow one PHP script to call another on a different server and get a return right?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.