FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Sending data to a different server.





Diablosblizz
Okay, I am in need of a way in which I can send data (variables) to a different apache server. So basically, here's an example below:

Mysite.com sends data (such as a password) to Mysite2.com then Mysite2.com updates and doesn't send anything back.

I need to do this without refreshing the page or having an iFrame. I figured the header("Location") wouldn't work as it just changes the page. I am thinking of using the $_GET method to retrieve the information from the URL.

So I am hoping to send the data over a URL, or something else that would be able to get the data. I was thinking cURL, but not sure on how that would work.
Raidation
You can use Ajax to run a php script so the page doesn't refresh.
Then, you can (download?) www.mysite2.com/?update=blah&updatew=blahblah
rvec
you could use curl to send a lot of post data. That way the user won't even be able to see anything happening (not even in javascript).
imagefree
i dont recommend cURL for such scenerio. If you have to send only the password or other limited information, you should give equal preference to GET and POST. I recommend GET because it works with my solution.

You can do this by trying to fetch the response headers sent by the destination server in response to your request.


Code:
get_headers('http://www.example.com/dir/script.php?password=this_is_password&otherdata=12345');


and do nothing else. Your request is submitted and the destination server would do its work.

another solution is file_get_contents() function but i recommend the first one because you dont want to receive any output.

Also you can ensure the success or failure of the request by sending relevent headers in response to request, and those headers can be saved in a variable and can be examined lateron. See documentation or ask here.
Related topics
Frihost.com website transfer to different server
Sending arbitrary data to/from PHP
Microsoft gunning for Adobe's PDF format?
AJAX tutorial [2nd part now updated]
Warcraft III port forwarding
Using a different server to mail emails?
Server 1 problems
The Next Step?
Sig display - only once.
Anyway to unblock a particular IP through DirectAdmin?
phpBB on another server
Need help with installing wbblite
How to write a code which will keep bandwidth to a minimum?
Building Web Forms In Flash
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.