I posted this in php freaks but they can't seem to solve the problem. I can't write to a text file.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Uploaded?</title>
<link href="cssface.css" rel="stylesheet" type="text/css" />
</head>
<body text=#FFFFFF><br />
<?php
if(isset($_POST['newssubmit'])) {
$title = $_POST['title'];
$date = $_POST['date'];
$time = $_POST['time'];
$poster = $_POST['poster'];
$news = $_POST['message'];
foreach($_POST['check'] as $value) {
$check_type .= "Checked: $value\n";
}
// set file to write
$file = "http://hypboard.com/thehyp/generalnews.txt";
// open file
$fh = fopen($file, 'w') or die('Could not open file!');
// write to file
fwrite($fh, "hi ") or die('Could not write to file');
// close file
fclose($fh);
echo " It might have worked? ";
echo $title;
echo $date;
echo $time;
echo $poster;
echo $news;;
echo $check_type;
}
else
{
echo "doh";
}
?>
</body>
</html>
Error:
[Mon Jul 21 22:49:42 2008] [error] [client 67.225.204.158] File does not exist: /home/hypboard/public_html/403.shtml
[Mon Jul 21 22:49:42 2008] [error] [client 67.225.204.158] (13)Permission denied: file permissions deny server access: /home/hypboard/public_html/thehyp/generalnews.txt
but the file does exist?
http://hypboard.com/thehyp/generalnews.txt
Tried permissions on the file and the folder, I tried using the whole home/hypboard/public etc... I tried having it create the file. I tried putting the file in other locations on our server... no dice. help?