require_once("../database.php");
require_once("adminfuncties.php");
require_once("cat_navigatie.php");
if(isset($_POST[s1]))
{
$MyCategory = strip_tags($_POST[NewCategory]);
if(empty($MyCategory) || ereg("[[:punct:]]", $MyCategory) || (strlen($MyCategory) > 50))
{
echo "
De naam mag niet langer zijn dan 50 tekens, enkel cijfers en letters gebruiken.";
}
else
{
$q1 = "insert into oneshop_categories set CategoryName = '$MyCategory' ";
mysql_query($q1) or die(mysql_error());
unset($_POST);
}
}
?>
$q1 = "select * from oneshop_categories order by CategoryName";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) > '0')
{
echo "
Deze ctegories zijn reeds aanwezig:
";
while($a1 = mysql_fetch_array($r1))
{
echo "$a1[CategoryName]
";
}
echo "";
}
?>