[Coco] CoCo Fest site

Dave Kelly daveekelly at earthlink.net
Tue Dec 26 22:28:15 EST 2006


Roger..
I am going to post some code for a signup sheet. Use it if you want or 
not if you want.  I use it on the fly fishing web site I administer.

Dave
=============================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta name="generator" content="Bluefish 1.0.5">
<meta name="author" content="root">
<meta name="date" content="2006-10-29T14:01:29-0600">
<meta name="copyright" content="">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; 
charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="0">
</head>
<body style="background-color: #b8a89a; color: #572c06; margin-left: 
1in; margin-top: 1in; margin-right: 1in; vlink: $598000; link: #fff000" >
<br clear="all"><br clear="all">
<p>When you click on one of the events below, you will be taken to a 
secure, password protected directory. You were issued a user name and 
pass word recently and ask to record it. We are taking this precausion 
to protect sensitive information, namely your email address and phone 
number. This information will be available to any member who comes here 
to sign up for the event. </p><br clear="all"><p>Use  this information 
to phone or <b>email</b> other members for the purpose of whatever you 
need to know about an event/outing.</p>
<h1 align="center"><font color="#598099">Events and Outings Sign Up 
Page</font></h1>
<div align="center">
<!-- The next 4 lines are the only thinge that ever need regular 
maintance -->
  <!-- <a href="signup/guestbook1.php"><h3>Aaron Hammers November 
Trip</h3></a><br> -->
  <!--  <a href="signup/guestbook2.php"><h3>Light House 
Lakes</h3></a><br> -->
  <!-- <a href="signup/guestbook3.php"><h3>7 Lakes Damon</h3></a><br> -->
  <a href="signup/guestbook4.php"><h3>Cold Springs</h3></a><br>
  </div>
</center>
</body>
</html>
=================================================
<?php

/********************************************
  * Simple PHP Guestbook4                     *
  * by Justin                                *
  * Version 1.0                              *
  * 2003-Feb-01                              *
  * Works with PHP version 4.1.0 and higher  *
  ********************************************/



/********************************************
  * CHANGE THIS to the file you want         *
  * to store all the info in.                *
  * Make sure the file exists                *
  * and is CHMODed to 777                    *
  *********************************************/

$file='./list-ColdSprings.txt';

/********************************************
  * you don't need to edit anything below here
********************************************/

error_reporting(1);
$mode=$_GET['mode'];
if($mode!='view' && $mode!='sign') $mode=$_POST['mode'];
if($mode!='view' && $mode!='sign') $mode='sign';
$name=$_POST['name'];
$site=$_POST['site'];
$phone=$_POST['phone'];
$date=date('m/d/Y');
$self=$_SERVER['PHP_SELF'];

($handle=fopen($file,'a+') or die("Could not open file: $file"));

if($mode=='sign')
{
     if($name!='') fwrite($handle,"$date\n$name\n$site\n$phone\n");
     echo "<form method='post' action='$self'>
     <input type='hidden' name='mode' value='sign'>
     <b>Date</b>: $date
     <b>Name</b>: <input type='text' name='name'>
     <b>Email</b>: <input type='text' name='site'>
     <b>Phone</b>: <input type='text' name='phone'>
     <input type='submit' value='Sign'>
     </form>
     <a href=\"$self?mode=view\">  View Sign Up Sheet</a>";
}
else
{
     $a=array_reverse(file($file));
     for($i=0;$i<count($a)-3;$i+=4)
     {
         echo '<b>Date</b>: '.htmlentities($a[$i+3]);
         echo '<p><b>Name</b>: '.htmlentities($a[$i+2]);
         echo '<b>Email</b>: '.htmlentities($a[$i+1]);
         echo '<b>Phone</b>: '.htmlentities($a[$i]);
         echo '<hr><p>';
     }
     echo "<a href=\"$self?mode=sign\"> Sign Sign Up Sheet</a>";
}

fclose($handle);

?>



More information about the Coco mailing list