[code]<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><? include("include.php"); chdir(".."); ?> <? if (!isset($_COOKIE['mys_admin'])) { exit; } if (!isset($_COOKIE['mys_pass'])) { exit; } function getname($thename) { global $mysql_server,$mysql_user,$mysql_pass,$mysql_db; mysql_connect($mysql_server,$mysql_user,$mysql_pass); mysql_select_db($mysql_db); $tmpquery = mysql_query("SELECT * FROM `approved` WHERE LOWER(`name`) = '".strtolower($thename)."'"); $tmpresult = @mysql_fetch_array($query); mysql_close(); return empty($tmpresult); } if (isset($submit)) { if ($name == "") { echo "<b>Your template must have a name!" ; exit ; } if ($description == "") { echo "<b>Your template must have a description!" ; exit ; } if (empty($file)) { echo "<b>You must upload a 150x150 thumbnail with your code!" ; exit ; } $count = 1; $old_name = $name; $alias = ereg_replace("[^[:space:]a-zA-Z0-9*_.-]", "", $name); $alias = str_replace(" ","-",strtolower($alias)); $typestr = ereg_replace("[^[:space:]a-zA-Z0-9*_.-]", "", $typestr); $typestr = str_replace(" ","-",strtolower($typestr)); foreach ($_FILES as $file) { if (array_search(strtolower(substr($file['name'],strrpos($file['name'], '.')+1)), $config['ftypes']) == false) { echo "<B>Invalid image file type!</B>"; exit; } $ext = strtolower(substr($file['name'], strrpos($file['name'], '.')+1)); if (move_uploaded_file($file['tmp_name'], $script_dir . "thumbs/" . $typestr . "_layout_" . $alias . "." . $ext)) { mysql_connect($mysql_server,$mysql_user,$mysql_pass); mysql_select_db($mysql_db); $time = time(); mysql_query("INSERT INTO `pending` VALUES('".$time."','".addslashes($name)."','".addslashes($description)."','".$type."','".$category."','".strtolower($_COOKIE['mys_admin'])."','".$alias."','". $typestr . "_layout_" . $alias . "." . $ext."')"); $code[0] = ""; $temp = 1; while ($temp <= 10) { if (isset($_POST['code'.$temp])) { $code[$temp] = addslashes($_POST['code'.$temp]); } else { $code[$temp] = ""; } $temp = $temp + 1; } mysql_query("INSERT INTO `codes` VALUES('".$time."','".$code[1]."','".$code[2]."','".$code[3]."','".$code[4]."','".$code[5]."','".$code[6]."','".$code[7]."','".$code[8]."','".$code[9]."','".$code[10]."')"); mysql_close(); } else { echo '<b>Thumbnail upload failed! Please contact site admin.</b><br>'; } } echo "<B>Your layout addition is currently pending. Note all pending layouts will not be published on our site until admin approval.</B><BR><BR>"; } ?> <B>UPLOAD LAYOUT</B><BR> <form name="upload" method="post" action="admincp.php?id=upload2" enctype="multipart/form-data"> <? $type = explode("_",$type); $type[1] = str_replace(" ","-",strtolower($type[1])); ?> <input type="hidden" name="type" value="<?=$type[0]?>"> <input type="hidden" name="codes" value="<?=$type[2]?>"> <input type="hidden" name="typestr" value="<?=$type[1]?>"> Type: <?=$type[1]?><BR><BR> Category: <select name="category"> <? mysql_connect($mysql_server,$mysql_user,$mysql_pass); mysql_select_db($mysql_db); $query = mysql_query("SELECT * FROM `categories`"); while ($result = mysql_fetch_assoc($query)) { echo '<option value="'.$result["id"].'">'.$result["name"].'</option>'; } mysql_close(); ?> </select><BR><BR> 150x150 Thumbnail: <input type="file" name="file"><br> Name: <input type="text" name="name"><BR><BR> Description:<br> <textarea name="description" cols=25 rows=5></textarea><br><BR> CODES:<BR><BR> <? mysql_connect($mysql_server,$mysql_user,$mysql_pass); mysql_select_db($mysql_db); $query = mysql_query("SELECT * FROM `code_names` WHERE `id` = '".$type[0]."' LIMIT 1"); $result = mysql_fetch_array($query); $temp = 1; while ($temp <= $type[2]) { $str = "code".$temp; echo $result[$str].":<br>"; echo '<textarea name="code'.$temp.'" cols=50 rows=10></textarea><br><br>'; $temp = $temp + 1; } mysql_close(); ?> <input type="submit" name="submit" value="Add Layout"> </form> </td> </tr> </table> [/code] that is the entire file......... THANKS!!!!!!!!!!!!! It gave parse errors in the line 58 area