Имам проблем, а той е следния:
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/a1562766/public_html/apedit.php on line 10
Warning: fwrite(): supplied argument is not a valid stream resource in /home/a1562766/public_html/apedit.php on line 11
Warning: fclose(): supplied argument is not a valid stream resource in /home/a1562766/public_html/apedit.php on line 12
Файлове:
apedit.php
apedit1.php
Как да оправя проблема? +1
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/a1562766/public_html/apedit.php on line 10
Warning: fwrite(): supplied argument is not a valid stream resource in /home/a1562766/public_html/apedit.php on line 11
Warning: fclose(): supplied argument is not a valid stream resource in /home/a1562766/public_html/apedit.php on line 12
Файлове:
apedit.php
Код:
<?php
session_start();
if (!isset($_SESSION['login'])) {
header("Location: ../admin/index.php");
}
?>
<?php
include("connect.php");
$text = $_POST['text'];
$fp = fopen("$file", "w");
fwrite($fp, $_POST['text']);
fclose($fp);
?>
apedit1.php
Код:
<?php
session_start();
if (!isset($_SESSION['login'])) {
header("Location: ../admin/index.php");
}
?>
<link href="codes/mstyle.css" rel="stylesheet" type="text/css" />
<?php
include("connect.php"); {
$file = $_SERVER['HTTP_REFERER'];
$file1 = explode($file, '/');
$cont = file_get_contents($file);
echo "<div align='center'>Промяна на (<b>$file</b>)</div><br><form action='apedit.php' method='post'><div align='center'>
<textarea cols='100' rows='100' name='text'>$cont</textarea></div>
<br><div align='center'><input type='submit' value='Промени' class='edw'></form></div>";
}
?>
Как да оправя проблема? +1