<?

$f_nazev = $_POST['f_nazev'];
$f_url_odkazu = $_POST['f_url_odkazu'];

/*if(ereg("^[-0-9a-zA-Z. _ìÌ¹©èÈøØ¾®ýÝáÁíÍéÉùú]{1,30}$",$f_nazev)){*/
if($f_nazev == "" || $f_nazev == " " ){
echo "<div id=\"info\"><div id=\"bad\">Nebyl zadán název odkazu!<meta http-equiv='refresh' content='1;URL=index.php?id=odkazy'></div></div>";

}
else{
$cislo = $_SESSION["cislo"];

$obsah ="
<?
\$nazev_odkazu = \"$f_nazev\";
\$url_odkazu = '$f_url_odkazu';
?>
";
?>
<?
$file = FOpen ("../publikace/odkazy/odk$cislo.php", "w");
FWrite ($file, "$obsah"); 
FClose ($file);

if(File_Exists("../publikace/odkazy/odk$cislo.php")){
echo "<div id=\"info\"><div id=\"good\">Odkaz úspì¹nì ulo¾en a publikován <meta http-equiv='refresh' content='1;URL=index.php?id=odkazy'></div></div>";
}  
}
/*}
else{
echo "<div id=\"info\"><div id=\"bad\">Název odkazu obsahuje nepovolené znaky<meta http-equiv='refresh' content='1;URL=index.php?id=odkazy'></div></div>";
}*/
 unset($_SESSION['cislo']); 
?>