"; $form_tabletop=""; $monthcount=0; $form_month=""; while($daycount++<31) { $form_day.=""; } $yearcount=2006; $form_year=""; while($hourcount++<12) { $form_hour.=""; } $form_minute=""; $form_title=""; $form_desc=""; $form_url=""; $submit_check="
"; $form_bottom="
"; print "

Piece of Cake event entry form

"; print "
"; print "$form_order"; print "$form_tabletop"; print "Date "; print ""; print "$form_month"; print ""; print ""; print ""; print "$form_day"; print ""; print ""; print ""; print "$form_year"; print ""; print ""; print ""; print "Time"; print "Hour $form_hour"; print ""; print "Minute $form_minute"; print ""; print "Time of Day $form_tod"; print ""; print ""; print "Title"; print "$form_title"; print ""; print ""; print "Description"; print "$form_desc"; print ""; print ""; print "URL"; print "$form_url"; print ""; print "$form_bottom"; print "
"; print "

"; print "

"; print "$submit_check"; mysqli_connect("localhost","kcarr","bananas"); $year=$_GET['year']; $month=$_GET['month']; $day=$_GET['day']; $date="$year-$month-$day"; $hour=$_GET['hour']; $minute=$_GET['minute']; $tod=$_GET['tod']; if($tod=='pm'){ $hour+=12; } $time="$hour:$minute:00"; $title=$_GET['title']; $description=$_GET['desc']; $url=$_GET['url']; $link=mysqli_connect("localhost","kcarr","bananas"); mysqli_select_db($link,'kcarr'); $error=mysqli_error($link); if($error){ print "mySQL error: $error
"; } $query="INSERT INTO events VALUES ('$date','$time','$title','$description','$url','')"; mysqli_query($link, $query); $error=mysqli_error($link); if($error){ print "mySQL error: $error
"; } ?>

Valid XHTML 1.0!