TFD3 Posted April 4, 2009 Share Posted April 4, 2009 I have been trying to find a way to add a atom feed and a xsl style file into a php file. I have searched and searched and can not find anything. The atom feed: http://www.weather.gov/alerts-beta/al.atom The xsl style sheet: http://www.alabamaweather.org/rss/capatom.xsl somehow both of those need to go into a php file i.e. warn.php I have tried but keep getting an error. Thanks, Kenny Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/ Share on other sites More sharing options...
Maq Posted April 4, 2009 Share Posted April 4, 2009 And what's your question? Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801003 Share on other sites More sharing options...
TFD3 Posted April 4, 2009 Author Share Posted April 4, 2009 I need to be able to display the output of both of those files using PHP. It would be as if I wanted to use an include statement to display two php pages in one php file. Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801004 Share on other sites More sharing options...
TFD3 Posted April 4, 2009 Author Share Posted April 4, 2009 OK. I got half of this working. Here is the script that is half complete: <?php - xsl line - $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo $homepage; ?> I need to add the xsl line in the php script: <?xml-stylesheet href='capatom.xsl' type='text/xsl'?> however I cant just add that under <?php Any ideas on how to include this?? Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801029 Share on other sites More sharing options...
Daniel0 Posted April 4, 2009 Share Posted April 4, 2009 Just echo it above the other echo... Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801047 Share on other sites More sharing options...
TFD3 Posted April 4, 2009 Author Share Posted April 4, 2009 Just echo it above the other echo... It didnt work: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home2/alabamaw/public_html/rss/test2.php on line 3 <?php $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo '<?xml-stylesheet href='capatom.xsl' type='text/xsl'?>'; echo $homepage; ?> Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801267 Share on other sites More sharing options...
Daniel0 Posted April 4, 2009 Share Posted April 4, 2009 You cannot have a single quote within a single quote delimited string without escaping it. Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801277 Share on other sites More sharing options...
TFD3 Posted April 4, 2009 Author Share Posted April 4, 2009 You cannot have a single quote within a single quote delimited string without escaping it. If this is what your talking about I tired it and still got an error. <?php $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo '\<?xml-stylesheet href=\'capatom.xsl\' type=\'text/xsl\'?\>'; echo $homepage; ?> Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801292 Share on other sites More sharing options...
TFD3 Posted April 4, 2009 Author Share Posted April 4, 2009 any possible ideas? i have not touched PHP in a long time. thanks Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801374 Share on other sites More sharing options...
TFD3 Posted April 4, 2009 Author Share Posted April 4, 2009 i finally got it with some outside help. thanks to those who helped me get half way Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801397 Share on other sites More sharing options...
Maq Posted April 5, 2009 Share Posted April 5, 2009 Looks like you solved this but, you didn't mark it [sOLVED] so... You can use single quotes for attributes inside a double quoted string: $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo ""; echo $homepage; ?> Link to comment https://forums.phpfreaks.com/topic/152503-solved-atom-php/#findComment-801879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.