<?

include '../../config.php';
include '../../func.php';
head();

if ( isset($_POST['submit']) ) {
    
    $name = html( $_POST['name'] );
  
    
    if ( empty($name) ) {
        
        header('Location: index.php?mod=empty_add&result=error');
        
    } else {
        
    $result = mysql_query("INSERT INTO `photo_raz` SET `nazwan` = '".$name."'");
    
    if ( $result != NULL ) {
        header('Location: index.php?mod=razdel_add&result=good');
    } else {
        header('Location: index.php?mod=razdel_add&result=error');
    }        
        
    }
    
}
echo link2 . '<form action="razdel_add.php" method="post" name="form">';
echo '<b>Название раздела:</b><br/ ><input name="name" type="text" maxlength="50"/><br/ >';
echo '<input name="submit" class="submit" type="submit" value="Создать" /></form>' . div;