Really new to coding and ran into trouble trying to set up an XML feed. I know it's probably really easy and I have searched many tutorials but I keep receiving errors when adding the codes. The feed I'm trying to setup can be found at http://www.pokeraffiliatesolutions.com/docs/xmlfeeds.php. Now the code I used to load the feed was <?php if( ! $xml = simplexml_load_file('http://rakeback.thepokerdream.net/feeds/poker_rooms/cake-poker.xml') ) { echo 'unable to load XML file'; } else { echo 'XML file loaded successfully'; } ?> Now that I've loaded the code, I'm lost as to what to do next.
Try opening it up locally like this... $xml = simplexml_load_file('cake-poker.xml') If it's not on your server just fopen() it.. save it to your server, then load it locally.
What to do next really depends on what you want to do with the xml file once you have loaded it. At the moment, running the script will simply tell you if the file was loaded or not. What happens when you run the script? Does it load the file or not, or, does it give you an error. Knowing this would help with suggestions of what to do next...
Assuming you want to output the feed you have just loaded, you need to change the header and send. If this is part of another file, make sure there is not output before you change the header or you will get an error. Try this : <?php if( ! $xml = simplexml_load_file('http://rakeback.thepokerdream.net/feeds/poker_rooms/cake-poker.xml') ) { echo 'unable to load XML file'; } else { header ("content-type: text/xml"); echo $xml; } ?>