dropfaith Posted May 22, 2012 Share Posted May 22, 2012 Lets start with what i have working http://www.treasuretrooper.com/api/116fcbdb1cac242e789a892ebd2a0abb/approved/xml pull that xml file (no style) http://box1.host1free.com/~crimso/ is my current page as you see the xml file over in approved now (right side) <?php function getPage($url="http://www.treasuretrooper.com/api/116fcbdb1cac242e789a892ebd2a0abb/approved/xml"){ $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_FRESH_CONNECT,TRUE); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5); curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($ch,CURLOPT_REFERER,'http://www.treasuretrooper.com/'); curl_setopt($ch,CURLOPT_TIMEOUT,10); $html=curl_exec($ch); if($html==false){ $m=curl_error(($ch)); error_log($m); } curl_close($ch); return $html; } $html=getPage("http://www.treasuretrooper.com/api/116fcbdb1cac242e789a892ebd2a0abb/approved/xml"); $html=htmlentities($html); echo $html; ?> I just need t get the xml styled properly and im clueless as to how id do it with the curl function involved. So any direction would help tons on this. Also wondering why its showing the actual xml code tree i assumed it would only provide the information Quote Link to comment https://forums.phpfreaks.com/topic/262953-style-xml-pulled-using-curl-in-php-external-file/ Share on other sites More sharing options...
dropfaith Posted May 22, 2012 Author Share Posted May 22, 2012 sigh okay i cleared up all those issues but im running into an issue with something small due to being forced to use curl im clueless on progress as i just learned it i removed $html=htmlentities($html); Started styling it(im good on that now) BUt im having issues reversing its order right now its oldest date to newest. I have a date field Approved_On to work with that all has info in it. Also working on limiting the number of results to like 30 max . Again im dumb on this right now. So anything helps Quote Link to comment https://forums.phpfreaks.com/topic/262953-style-xml-pulled-using-curl-in-php-external-file/#findComment-1347806 Share on other sites More sharing options...
silkfire Posted May 23, 2012 Share Posted May 23, 2012 What do you mean by "style XML" ? XML is pure information in tags, this is not HTML. I suggest you insert all the data into a temporary database table, then select the data and sort on Approved_On column. Quote Link to comment https://forums.phpfreaks.com/topic/262953-style-xml-pulled-using-curl-in-php-external-file/#findComment-1347891 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.