-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrssfeed.php
More file actions
45 lines (42 loc) · 983 Bytes
/
rssfeed.php
File metadata and controls
45 lines (42 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<style>
<!--
body{
background-color: white;
}
-->
</style>
<body>
<form action="rssfeed.php" method="post">
<fieldset>
<legend>Feed</legend>
<table>
<tr>
<td>Please enter the address of the rss feed:</td>
<td><input type="text" name="feed_adr"></td>
</tr>
</table>
<p><input type="submit" value="Submit">
<input type="reset" name="Reset"></p>
</fieldset>
</form>
<?php
if (isset($_POST['feed_adr'])){
$objXML = simplexml_load_file($_POST['feed_adr']);
// var_dump($objXML);
echo $objXML->channel->title . "<br>";
echo $objXML->channel->link . "<br>";
echo $objXML->channel->description . "<br>";
foreach($objXML->channel->item as $item){
echo "<p>";
echo $item->title . "<br>";
echo $item->pubDate . "<br>";
echo $item->image . "<br>";
echo $item->description . "<br>";
echo $item->link . "</p>";
}
}
?>
</body>
</html>