What is wrong here?

<?php if((!$_GET['cena1'] and (!$_GET['parol'] and (!$_GET['cena2'])) { echo "<form action=redaktNovost.php method=GET>"; echo "<input name=parol type=password>"; echo "<input value='&#1042;&#1074;&#1077;&#1089;&#1090;&#1080; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100;' type=submit>"; echo "</form><br><br>"; } $parol = $_GET['parol']; $file = "parol.txt"; $open = fopen($file, "r"); $read = fread($open, filesize($file)); fclose($open); if ($parol == $read) { $nov = fopen("&#1089;ena1.txt", "r+"); @$redakt = fread($nov, filesize("cena1.txt")); fclose($nov); echo "<form action=redaktNovosti.php method=GET>"; echo "<input name=cena1 type=text value=$redakt>"; echo "<input type=hidden name=parol value=$parol>" echo "input submit value=&#1048;&#1079;&#1084;&#1077;&#1085;&#1080;&#1090;&#1100;>"; echo "</form>"; if(isset($_GET['cena1'])); { $novosti = $_GET['cena1']; $data = date('dmY'); $nov = fopen("cena1.txt", "w+"); { fwrite($nov, "$novosti"); } fclose($nov); } { $nov = fopen("&#1089;ena2.txt", "r+"); @$redakt = fread($nov, filesize("cena2.txt")); fclose($nov); echo "<form action=redaktNovosti.php method=GET>"; echo "<input name=cena2 type=text value=$redakt>"; echo "<input type=hidden name=parol value=$parol>" echo "input submit value=&#1048;&#1079;&#1084;&#1077;&#1085;&#1080;&#1090;&#1100;>"; echo "</form>"; if(isset($_GET['cena2'])); { $novosti = $_GET['cena2']; $data = date('dmY'); $nov = fopen("cena2.txt", "w+"); { fwrite($nov, "$novosti"); } fclose($nov); } } elseif ($parol) { echo "&#1053;&#1077;&#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1099;&#1081; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100;" } ?> 

Closed due to the fact that the essence of the question is not clear to the participants of DeKaNszn , PashaPash , Timofei Bondarev , etki , Qwertiy 1 May '15 at 21:50 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Use Notepad ++ Save the document in encoding without BOM. Check and sign. Maybe this is the reason. And check the closeness of all tags ... - new_russian_man

3 answers 3

Keep ready option

  <?php if((!$_GET['cena1'] and (!$_GET['parol'] and (!$_GET['cena2'])))) { echo "<form action=redaktNovost.php method=GET>"; echo "<input name=parol type=password>"; echo "<input value='&#1042;&#1074;&#1077;&#1089;&#1090;&#1080; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100;' type=submit>"; echo "</form><br><br>"; } $parol = $_GET['parol']; $file = "parol.txt"; $open = fopen($file, "r"); $read = fread($open, filesize($file)); fclose($open); if ($parol == $read) { $nov = fopen("&#1089;ena1.txt", "r+"); @$redakt = fread($nov, filesize("cena1.txt")); fclose($nov); echo "<form action=redaktNovosti.php method=GET>"; echo "<input name=cena1 type=text value=$redakt>"; echo "<input type=hidden name=parol value=$parol>"; // echo "<input type ="submit" value="&#1048;&#1079;&#1084;&#1077;&#1085;&#1080;&#1090;&#1100">"; //echo "</form>"; if(isset($_GET['cena1'])); { $novosti = $_GET['cena1']; $data = date('dmY'); $nov = fopen("cena1.txt", "w+"); { fwrite($nov, "$novosti"); } fclose($nov); } { $nov = fopen("&#1089;ena2.txt", "r+"); @$redakt = fread($nov, filesize("cena2.txt")); fclose($nov); echo "<form action=redaktNovosti.php method=GET>"; echo "<input name=cena2 type=text value=$redakt>"; echo "<input type=hidden name=parol value=$parol>"; echo "input submit value=&#1048;&#1079;&#1084;&#1077;&#1085;&#1080;&#1090;&#1100;>"; echo "</form>"; if(isset($_GET['cena2'])); { $novosti = $_GET['cena2']; $data = date('dmY'); $nov = fopen("cena2.txt", "w+"); { fwrite($nov, "$novosti"); } fclose($nov); } } if ($parol) { echo "&#1053;&#1077;&#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1099;&#1081; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100"; }} ?> 
  • no ... does not work - igolka97

The second line is blunted with a bracket. Nineteenth - no semicolon. I didn’t look further, because the php interpreter remarkably shows errors - try it yourself.

    First of all. Second line - not all lines are closed. Must be

     if((!$_GET['cena1'] and (!$_GET['parol'] and (!$_GET['cena2'])))) { 

    Further swears on these drains

     echo "<input type ="submit" value="&#1048;&#1079;&#1084;&#1077;&#1085;&#1080;&#1090;&#1100">"; echo "</form>"; 

    Writing a mistake

    Parse error: parse error, unexpected T_IF, expecting ',' or ';' in w:\www\44.php on line 22

    I do not know what you wanted to do here — I didn’t peer at the algorithm — there was no time. Check the syntax.