Jump to content

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


chaseb

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!
Link to comment
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?
Link to comment
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. 
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.