[UPHPU] Wish List

Jeffrey Moss jeff at opendbms.com
Mon Nov 15 13:53:20 MST 2004


A wish list sounds pretty simple, a database seems like overkill. Try this:

<?php
$wish_list = array();
$name = $_REQUEST['name'];

$handle = fopen("wish_list_$name.txt", "w");
for($i = 0; $i < 20; $i++) {
  $wish = $_REQUEST["Wish$i"];
  fputs($handle, "$wish\n");
}

$handle = fopen("wish_list_$name.txt", "r");
while (!feof($handle)) {
  $buf = fgets($handle, 1024);
  array_push($wish_list, rtrim($buf));
}
?>
<FORM METHOD="GET">
<TABLE BORDER="0" CELLPADDING="4">
<TR><TD BGCOLOR="#BBBBBB">Name: <INPUT TYPE="text" NAME="name" VALUE="<?= 
$name ?>" SIZE="20"/\
></TD></TR>
<?php
for($i = 0; $i < 20; $i++) {
  $value = $wish_list[$i];
?><TR><TD ALIGN="right">Wish <?= $i+1 ?>: <INPUT TYPE="text" NAME="Wish<?= 
$i ?>" SIZE="30" VA\
LUE="<?= $value ?>"/></TD></TR><?php
     }
?></TABLE><INPUT TYPE="submit"/></FORM>


As you can see I've got nothing better to do with my time...

-Jeff

----- Original Message ----- 
From: "Steven Retz" <sjr3t2 at gmail.com>
To: <uphpu at uphpu.org>
Sent: Monday, November 15, 2004 1:13 PM
Subject: [UPHPU] Wish List


> The orginal reason I wanted to learn PHP is to make a nice website for
> my family and friends.  And one goal I have been work towards, maybe
> to slowly, is to have a Web Wish List.  I mentioned this on the SLLUG
> group, and most poeple suggest I learn PHP to do this.  And so I am.
> But at my current rate, I do not think I will be able to create PHP
> Wish List web page in time.  Not long ago some one the SLLUG group
> posted some Wish List Web projects he/she found.
> PHP Gift Registry
> http://phpgiftreg.sourceforge.net/
>
> The Community Wish List Server
> http://fwls.sourceforge.net/
>
> myGifts
> http://mygifts.sourceforge.net/
>
> I have tried to find some on my own that use PostgreSQL, but have been
> unsuccessful.  So I have a few questions, 1) does anyone know of a
> wish list I could have that uses postgreSQL.  2) The wish lists that I
> listed do not have much docs and/or screen shots, so I am wondering if
> anyone here has used any of these, that would be willing to tell me
> their opinions of them.
>
> Steven Retz
>
>
> _______________________________________________
>
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>
> Sponsored by hostinginferno.com! 




More information about the UPHPU mailing list