[studentbooks15] r33 committed - Importing wishlist.php

0 views
Skip to first unread message

student...@googlecode.com

unread,
Sep 18, 2010, 8:43:13 PM9/18/10
to student...@googlegroups.com
Revision: 33
Author: av92386
Date: Sat Sep 18 17:42:32 2010
Log: Importing wishlist.php
http://code.google.com/p/studentbooks15/source/detail?r=33

Added:
/trunk/av92386/project

=======================================
--- /dev/null
+++ /trunk/av92386/project Sat Sep 18 17:42:32 2010
@@ -0,0 +1,48 @@
+<html>
+
+ <body>Wish List of <?php echo $_GET["user"]."<br/>";?>
+
+ <?php
+
+ $con = mysql_connect("http://hci.cs.sfsu.edu");
+
+ if (!$con) {
+
+ die('Could not connect: ' . mysql_error());
+
+ }
+
+ mysql_query("SET NAMES 'utf8'");
+
+ mysql_select_db("wishlist", $con);
+
+ $wisher = mysql_query("SELECT ID FROM wishers WHERE
name='".mysql_real_escape_string($_GET["user"])."'");
+
+ if (mysql_num_rows($wisher)<1) {
+
+ die("The person " .$_GET["user"]. " is not found. Please check
the spelling and try again" );
+
+ }
+
+ $wisherID = mysql_result($wisher, 0);
+
+ ?>
+<table border="black">
+ <tr>
+ <th>Item</th>
+ <th>Due Date</th>
+ </tr>
+ <?php
+ $result = mysql_query("SELECT * FROM wishes WHERE wisher_id=".
$wisherID);
+ while($row = mysql_fetch_array($result)) {
+ $desc = $row["description"];
+ $dueDate = $row["due_date"];
+ echo "<tr><td>" . strip_tags($desc,'<br><p><h1>')."</td>";
+ echo "<td>". strip_tags($dueDate)."</td></tr>\n";
+ }
+ mysql_close($con);
+?>
+ </table>
+ </body>
+
+</html>

Reply all
Reply to author
Forward
0 new messages