face = $face
facecolor = $facecolor
facewhich = $facewhich

"; #echo "
firstname = $firstname
homestate = $homestate"; #echo "
classof = $classof
superpower = $superpower
descriptor = $descriptor"; #echo "
actor = $actor"; #echo "
words = $words

"; # Add New Entry # $query = "INSERT INTO student (face, facecolor, facewhich, firstname, homestate, classof, superpower, descriptor, actor, words, wordswhich, id) VALUES($face,$facecolor,$facewhich,$firstname,$homestate,$classof,$superpower,$descriptor,$actor,$words,$wordswhich,NULL)"; $result = mysql_query($query); # Retrieve Id Number for the New Entry # $query = "SELECT * FROM student WHERE face = $face AND facecolor = $facecolor AND facewhich = $facewhich AND firstname = $firstname AND homestate = $homestate AND classof = $classof AND superpower = $superpower AND descriptor = $descriptor AND actor = $actor AND words = $words AND wordswhich = $wordswhich;"; $result = mysql_query($query); if($result){ $row = mysql_fetch_array ($result); $id = $row["id"]; echo "id=$id"; } else{ echo "id=0"; } } if(!$id && !$admin){ readfile("header_head.html"); #dump_file("http://www.pbs.org/includes/adbanners/sites/americanhigh.html"); readfile("header.html"); readfile("sortform.html"); if(!$range) $range = 0; $navstring = ""; dbConnect(); $result = mysql_query($query); if($result){ $rows = array(0,0,0,0); $rowsid = array(0,0,0,0); $i = 0; while($row = mysql_fetch_array ($result)){ $i++; if($i > $range * 4 && $i < ($range * 4) + 5){ $rows[$i - 1 - $range*4] = $row; $rowsid[$i - 1 - $range*4] = $i; } } $totalentries = 44084; #$i; $maxrange = ($i - 1) % 4; $maxrange = ($i - 1 - $maxrange) / 4; $navstring .= "
"; if($sort){ $navstring .= "SORTED BY "; if($superpower){ $superpowers = array("","X-RAY VISION","CHANGING SHAPE","SUPER SPEED","DEFYING GRAVITY","FLYING","SUPER GENIUS","TIME TRAVEL","MIND READING","SUPER STRENGTH","SEEING THE FUTURE","INVISIBILITY"); $navstring .= "SUPERPOWER: $superpowers[$superpower]"; $query = "SELECT * FROM student WHERE superpower = $superpower ORDER BY id DESC limit 100;"; $hrefstring = "&sort=1&superpower=$superpower"; } else if($state){ $thestates = array("","ALABAMA","ALASKA","ARIZONA","ARKANSAS","CALIFORNIA","COLORADO","CONNECTICUT","DELAWARE","FLORIDA","GEORGIA","HAWAII","IDAHO","ILLINOIS","INDIANA","IOWA","KANSAS","KENTUCKY","LOUISIANA","MAINE","MARYLAND","MASSACHUSETTS","MICHIGAN","MINNESOTA","MISSISSIPPI","MISSOURI","MONTANA","NEBRASKA","NEVADA","NEW HAMPSHIRE","NEW JERSEY","NEW MEXICO","NEW YORK","NORTH CAROLINA","NORTH DAKOTA","OHIO","OKLAHOMA","OREGON","PENNSYLVANIA","RHODE ISLAND","SOUTH CAROLINA","SOUTH DAKOTA","TENNESSEE","TEXAS","UTAH","VERMONT","VIRGINIA","WASHINGTON","WASHINGTON,D.C.","WEST VIRGINIA","WISCONSIN","WYOMING"); $navstring .= "STATE: $thestates[$state]"; $query = "SELECT * FROM student WHERE homestate = $state ORDER BY id DESC limit 100;"; $hrefstring = "&sort=1&state=$state"; } else if($classof){ $navstring .= "CLASS OF $classof"; $query = "SELECT * FROM student WHERE classof = $classof ORDER BY id DESC limit 100;"; $hrefstring = "&sort=1&classof=$classof"; } else{ } } else{ $navstring .= "UNSORTED"; $query = "SELECT * FROM student ORDER BY id DESC limit 100;"; $hrefstring = ""; } $navstring .= ""; if($range) $navstring .= "first | previous | "; else $navstring .= "first | previous | "; if($range < $maxrange) $navstring .= "next | last"; else $navstring .= "next | last"; $navstring .= "
"; echo "$navstring"; if($i){ echo ""; for($i=0;$i<4;$i++){ if($rows[$i]){ $face = $rows[$i]["face"]; $facecolor = $rows[$i]["facecolor"]; $facewhich = $rows[$i]["facewhich"]; $firstname = $rows[$i]["firstname"]; $homestate = $rows[$i]["homestate"]; $classof = $rows[$i]["classof"]; $superpower = $rows[$i]["superpower"]; $descriptor = $rows[$i]["descriptor"]; $actor = $rows[$i]["actor"]; $words = $rows[$i]["words"]; $wordswhich = $rows[$i]["wordswhich"]; if($i == 2) echo "\n"; echo "\n"; if($i == 1) echo "\n"; } } echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "$rowsid[$i] of $totalentries
\n\n"; echo "$navstring
"; } else echo "
No Results

"; } else{ echo "
No Results

"; } readfile("footer.html"); } ?>