Jump to content

[SOLVED] ATOM + PHP


TFD3

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.