-
Notifications
You must be signed in to change notification settings - Fork 1
/
mobil.php
71 lines (48 loc) · 2.17 KB
/
mobil.php
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<rss version="2.0">
<channel>
<title>Bloggen</title>
<link>http://localhost/TNM065/proj/index2-wml.php</link>
<description></description>
<author> MH </author>
<?php
$link = mysql_connect("localhost", "root", "root")
or die("Could not connect");
mysql_select_db("project")
or die("Could not select database");
$query = "SELECT id,date,signature,title,text
FROM post ORDER BY date DESC";
$result = mysql_query($query)
or die("Query failed");
$returnstring = "";
while ($line = mysql_fetch_object($result)) {
$title = $line->title;
$date = $line->date;
$signature = $line->signature;
$text = $line->text;
$ID = $line->id;
$queryimage = "SELECT path , image.ID, post.ID, pictext FROM image JOIN post WHERE image.ID = post.ID ORDER BY post.date DESC";
$resultimage = mysql_query($queryimage);
$returnstring = $returnstring . "<item>";
$returnstring = $returnstring . "<title> $title </title>";
$returnstring = $returnstring . "<description> $text </description>";
$returnstring = $returnstring . "<author>[email protected] ($signature) </author>";
$returnstring = $returnstring . "<pubDate> $date </pubDate>";
$returnstring = $returnstring . "</item>";
$returnstring = $returnstring . "<image>";
while ($lineimage = mysql_fetch_object($resultimage)){
$path = $lineimage->path;
$pictext = $lineimage->pictext;
$IDimage = $lineimage->ID;
if($ID == $IDimage){
$returnstring = $returnstring . " <url>$path</url>";
$returnstring = $returnstring . " <title>Bild</title> ";
$returnstring = $returnstring . "<link>http://localhost/TNM065/proj/index2-wml.php</link>";
$returnstring = $returnstring . "<description> $pictext </description>";
}
}
$returnstring = $returnstring . "</image>";
}
print utf8_encode($returnstring);
?>
</channel>
</rss>