fwd4 Posted July 3, 2007 Share Posted July 3, 2007 Quick question (I hope)... When someone is redirected to my site I am given a user ID and a token parameter on the URL like so: http://www.mysite.com/download.php?userID=12345&token=ABCDEF I'm picking the user ID and token parameters up from the URL using GET. Once I have them I need to check the validity with a 3rd party API in the format: http://xml.checker.com/tokencheck.asp?t=ABCDEF&u=12345 In return I get a simple XML output of either true or false: <?xml version="1.0"?> <response success="false"> </response> My question is how do I make the make the HTTP request to the tokencheck.asp and parse back the simple XML? I'm pretty new to all of this but enjoying it immensely! Thanks in advance FWD4 Link to comment https://forums.phpfreaks.com/topic/58313-solved-make-a-http-request-behind-the-scenes-query-an-api/ Share on other sites More sharing options...
per1os Posted July 3, 2007 Share Posted July 3, 2007 www.php.net/simplexml (may be for PHP 5 only) www.php.net/xml (should be for both) Link to comment https://forums.phpfreaks.com/topic/58313-solved-make-a-http-request-behind-the-scenes-query-an-api/#findComment-289132 Share on other sites More sharing options...
fwd4 Posted July 3, 2007 Author Share Posted July 3, 2007 thanks frost110 - I have been looking at these already so I must be in the right place. How would I go about making the http request to the 3rd party tokencheker.asp? Link to comment https://forums.phpfreaks.com/topic/58313-solved-make-a-http-request-behind-the-scenes-query-an-api/#findComment-289144 Share on other sites More sharing options...
per1os Posted July 3, 2007 Share Posted July 3, 2007 www.php.net/file_get_contents www.php.net/curl either should work. Link to comment https://forums.phpfreaks.com/topic/58313-solved-make-a-http-request-behind-the-scenes-query-an-api/#findComment-289157 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.