Я написал код, но у меня почемуто не работает Edit. У меня файлы: article1.txt article2.txt article3.txt edit_1.php
| Код | <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <title>Article 1 : edit mode</title> </head> <body bgcolor="white"> <?php $filename="article1.txt"; include("edit_engine.txt"); ?> <br> <a href="editor.html">List of articles</a> </body> </html>
|
edit_2.php
| Код | <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <title>Article 2 : edit mode</title> </head> <body bgcolor="white"> <?php $filename="article2.txt"; include("edit_engine.txt"); ?> <br> <a href="editor.html">List of articles</a> </body> </html>
|
edit_3.php
| Код | <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <title>Article 3 : edit mode</title> </head> <body bgcolor="white"> <?php $filename="article3.txt"; include("edit_engine.txt"); ?> <br> <a href="editor.html">List of articles</a> </body> </html>
|
edit_engine.txt
| Код | <form method="GET"> <input type="text" size="100" value="<? readfile ($filename) ?>" name="nm"> <input type="submit" value="Apply changes"> </form> <? if ($nm) { $fd = fopen ($filename , "w") or die ("Can't open $filename") ; fwrite ($fd , $nm) ; fclose($fd) ; } ?>
|
editor.html
| Код | <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <title> List of articles </title> </head> <body bgcolor="white"> Article 1. <a href="read_1.php">Read</a>/<a href="edit_1.php">Edit</a><br> Article 2. <a href="read_2.php">Read</a>/<a href="edit_2.php">Edit</a><br> Article 3. <a href="read_3.php">Read</a>/<a href="edit_3.php">Edit</a><br> </body> </html>
|
read_1.php
| Код | <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <title>Article 1 : read mode</title> </head> <body bgcolor="white"> <?php readfile("article1.txt"); ?> <br> <a href="editor.html">List of articles</a> </body> </html>
|
read_2.php
| Код | <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <title>Article 2 : read mode</title> </head> <body bgcolor="white"> <?php readfile("article2.txt"); ?> <br> <a href="editor.html">List of articles</a> </body> </html>
|
read_3.php
| Код | <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <title>Article 3 : read mode</title> </head> <body bgcolor="white"> <?php readfile("article3.txt"); ?> <br> <a href="editor.html">List of articles</a> </body> </html>
|
У меня ошыбка Undefined variable: nm in edit_engine.txt on line 7 |