Location: PHPKode > scripts > phpGiftList > phpgiftlist/display.php
<html>
<body>
<style>
body{background-color:#FFFFFF}
A{color:red; text-decoration:none}
A:hover{color:red}
A:visited:{color:red}
SPAN.itemname{font-family:verdana,arial,helvetica; font-size=12pt; font-weight:bold}
DIV.itemlisting{font-family:verdana,arial,helvetica; font-size=10pt}
DIV.itemdesc{position:relative; left: 2em;}
H2{font-family:verdana,arial,helvetica; font-size=15pt; font-weight:bold}
P{font-family:verdana,arial,helvetica; font-size=10pt}
UL{font-family:verdana,arial,helvetica; font-size=10pt}
</style>
<!-- phpGiftList - a gift list manager written in PHP and using mySQL
    Copyright (C) 2000  O.M. Jenkins
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-->

<?php

$db = mysql_connect("localhost", "root");

mysql_select_db("giftlist", $db);

$result = mysql_query("SELECT item.* 
FROM item 
WHERE ((item.item_hidden = 'N')) ",$db);

if ($myrow = mysql_fetch_array($result))  {

?>

	<h2>phpGiftList v. 0.1</h2>
	<p>phpGiftList is a simple gift list manager written in PHP and using mySQL as a database and released under the terms of the GPL. It displays the list of requested gifts from the database with a link to buy online. Some of the fields in the db I haven't decided how I'd like displayed. The size and misc information fit somewhere, but I haven't decided where. The user interface itself is below this text.</p>
<p><b>Future enhancements:</b>
<br>
<ul>
<li>An improved admin interface for adding and editing items</li>
<li>Security - there needs to be some restraints on said admin interface so that someone can't screw up your list.</li>
<li>An "I'm buying this for him" interface. It would allow a gift buyer to click a link next to the item and indicate a name and email. The item will then be hidden. There needs to be some security here as well so that someone doesn't come along and hide your entire list.</li>
<li>A possible far enhancement would be hiding the item until a certain date has passed.</li>
</ul>
</p>
<p><b>Use:</b></p>
Before going further, please note that there is currently no security of any sort in this system. I run it only locally for now. Use it at your own risk.
<br>
<br>Create a database called: item. The SQL for creating the table as well as two sample records is in: database.sql. The user (public) interface is display.php. The admin interface is in adminadmin.php and admindisplay.php.
<hr>
<?php

	do {	

	
	   printf("<div class=\"itemlisting\"><span class=\"itemname\">%s</span> - $<i>%s</i><br><div class=\"itemdesc\">%s\n", $myrow["item_name"], $myrow["item_price"], $myrow["item_desc"]);

		printf("<br>Buy at: <a href=\"%s\" target=\"blank\">%s</a></div></div><p>\n", $myrow["URL"], $myrow["item_vendor"]);

	 } while ($myrow = mysql_fetch_array($result));

		} else {

		echo "Sorry, no records were found!";

	}

?>
</body>
</html>
Return current item: phpGiftList