"gif","image/jpeg"=>"jpg","image/png"=>"png"); if ($deleteid) { mysql_query("delete from cats where catid = '$deleteid'"); $deletesql = mysql_query("select id,pictype from pics where catid = '$deleteid'"); if (file_exists("catimages/$catid.jpg")) { unlink("catimages/$catid.jpg"); } while ($deleterow = mysql_fetch_array($deletesql)) { $picid = $deleterow[0]; $pictype = $deleterow[1]; $picext = $extarray[$pictype]; $picname = $picid.".".$picext; if (file_exists("images/$picname")) { unlink("images/$picname"); } } } if ($submit) { $pictitle = $_POST['pictitle']; $picdesc = $_POST['picdescription']; $tmp = $_FILES['binarypic']['tmp_name']; $name = $_FILES['binarypic']['name']; $filesize = $_FILES['binarypic']['size']; $pictype = $_FILES['binarypic']['type']; $catid = $_POST['catid']; //you can add to this... $ext = $extarray[$pictype]; $err = mysql_query("insert into pics (pictitle,picdesc,pictype,catid) values ('$pictitle','$picdesc','$pictype','$catid')"); $lastid = mysql_insert_id();//this is huge gets the last id number!!! $newpicname = $lastid.".".$ext; move_uploaded_file($tmp,"images/$newpicname"); } $editid = $_GET['editid']; if ($editid) { $cataction = "Edit Category"; $editcatsql = mysql_query("select catid, catname from cats where catid = '$editid'"); $editcatrow = mysql_fetch_array($editcatsql); $upcatname = $editcatrow[1]; $upcatid = $editcatrow[0]; $upcatpic = $upcatid.".jpg"; } $deleteid = $_GET['deleteid']; $addcat = $_POST['addcat']; $catid = $_POST['catid']; $catname = $_POST['catname']; $catidtoupdate = $_POST['catidtoupdate']; if ($catidtoupdate) { mysql_query("update cats set catname = '$catname' where catid = '$catidtoupdate'"); $tmp = $_FILES['catpic']['tmp_name']; if ($tmp) { move_uploaded_file($tmp,"catimages/".$catidtoupdate.".jpg"); } } ?> Welcome to StreetScape
Logout'; else $link = 'Login'; ?>
Add Event Name
Event Name:
Return to add mode"; //list photo, title and descrip //add delete and update functionality //add pic functionaility for categories ?>



Add a pic

Picture Title:
Picture Description:
Log out
"; } echo "$catname Edit Delete
"; } ?>