Jump to content
php.lv forumi

Man izmet kļūdu.. nezinu kas par vainu


marnix
 Share

Recommended Posts

Man izpildot skriptu izmet kļūdu

 

Notice: Undefined variable: region in c:\web\easyphp1-8\www\generate.php on line 5

 

no sekojoša skripta

 

<?
$name = $_POST['Naktsmitnes_veids'];
$text = $_POST['Nosaukums'];
$file=fopen($text.".html", 'w+');
fputs($file,"<h3><strong>$name '$text' $region </strong></h3><br> <img src='icons/$name.gif' alt='$name'>");
fclose($file);
?>
<?
$links = ("$name,links");
$file=fopen($links.".html",'a');
fputs($file,"<a href='$text.html'>$name '$text'</a><br>");
fclose($file);
?>

 

Ja varat pasakiet kas par vainu... :D

Link to comment
Share on other sites

veelviens errors

 

Warning: Division by zero in c:\web\easyphp1-8\www\generate.php on line 5

 

Warning: Division by zero in c:\web\easyphp1-8\www\generate.php on line 11

 

 

<?
$region = $_POST['Region'];
$name = $_POST['Naktsmitnes_veids'];
$text = $_POST['Nosaukums'];
$file=fopen($region/$text.".html", 'w+');
fputs($file,"<h3><strong>$name '$text' $region </strong></h3><br> <img src='icons/$name.gif' alt='$name'>");
fclose($file);
?>
<?
$links = ("$name,links");
$file=fopen($region/$links.".html",'a');
fputs($file,"<a href='$region/$text.html'>$name '$text' $region</a><br>");
fclose($file);
?>

Link to comment
Share on other sites

Lūdzu nequotēt bezjēgā (bubu)

Pieņemts zināšanai (orion)

 

Dalīt ar nulli nedrīkst!

kas tas tāds?

$file=fopen($region/$text.".html", 'w+');

jābūt nu vismaz šādi:

$file=fopen($region.'/'.$text.".html", 'w+');

 

Vispār saproti, ko tur esi darījis?

mēģini ar tekstu veikt matemātiskas darbības... :DD

Edited by orion
Link to comment
Share on other sites

 Share

×
×
  • Create New...