Maccyjam Posted August 13, 2012 Share Posted August 13, 2012 Hello,I'm wanting to pull data from a server using a HTTP GET method and then display the data on a HTML webpage.I have looked into this but couldn't find anything regarding it. I assume it will require Javascript or PHP or some other form of scripting, but if someone could be point me in the right direction, that'd be great.Thanks in advance, Link to comment Share on other sites More sharing options...
niche Posted August 13, 2012 Share Posted August 13, 2012 Here you go: http://www.w3schools.com/php/php_get.asp Link to comment Share on other sites More sharing options...
thescientist Posted August 13, 2012 Share Posted August 13, 2012 it seems more like you would want to use something like curl to make HTTP requests (GET/POST) in PHP to said server and process the response.http://php.net/manual/en/book.curl.php 1 Link to comment Share on other sites More sharing options...
niche Posted August 13, 2012 Share Posted August 13, 2012 (edited) Didn't know that thescientist. Very cool. Thanks. PM: Scrapbook Edited August 13, 2012 by niche Link to comment Share on other sites More sharing options...
Maccyjam Posted August 13, 2012 Author Share Posted August 13, 2012 Thanks for those links, they seem pretty useful.The link takes two parameters when performing the HTTP GET method: One for the API and one for an ID number. Upon accessing it (through a web browser), it provides an XML file of information.So what would be the best method to pull the data using HTML/PHP and then parse the XML tags into an easy to read format in the HTML file?I'm sorry for the large and probably stupid sounding request, I'm new to PHP and things like that but it is something that I would definitely like to learn. Link to comment Share on other sites More sharing options...
thescientist Posted August 13, 2012 Share Posted August 13, 2012 review the cURL documentation or look for some simple examples online. after that, you can use simple xml to load a string into an XML document for you to work with.http://php.net/manual/en/book.simplexml.php Link to comment Share on other sites More sharing options...
birbal Posted August 15, 2012 Share Posted August 15, 2012 http://in.php.net/manual/en/simplexmlelement.construct.php if it is GET you can send directly a GET request from simplexml by specifying file URL in first param in constructor followed by passing true to third param and then fetch the xml document. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now