<?
$rez=include("setup.php");
if (! $rez) //if can't find setup.php or not chmod'ed 
 {
  echo "<font color=red>Check Your setup.php file !</font>";
	exit;
 }

//-------------- update dir ---------------------
if (isset($updateme))		
{
       $result=0;
       if( (check_if_exist($namedirNew,"category","CategoryName"))>=1)
	print "This category exists";
       else
       {	
       $result=mysql_query("
       update category set
       CategoryName='$namedirNew'
         where ID=$id
         ") or die (mysql_error(). " : ".mysql_errno());

         if (! $result )
          print "Sorry,You are trying to enter invalid data ";
         else
          print "Your data was modified";

       }
       exit;
}
//----------------------- end update ----------------




	$sql = "SELECT * FROM category where ID=$loginis";	
        $result = mysql_query($sql) or  die (mysql_error(). " : ".mysql_errno());
        $row=mysql_fetch_object($result);


?>
<br>
<form action=<?=$PHP_SELF?> method=post>
<input type="hidden" name=updateme><BR>
<input type=hidden name=id value='<?=$row->ID?>'>
Update this category <input type=text name=namedirNew value='<?=$row->CategoryName;?>'>
<input type=Submit name=submit value=Submit>
</form>