My apologies if this has been covered before. I tried searching but I didn't come up with anything.
Anyhow, here is my problem. I'm making a news page that can be updated via the web. My first page contains a form where the user inputs the news post. This is passed to a second page that stores the information in a flat file. Then the third page reads the flat file and displays the news post. Easy enough right?
If works just fine on my own test web server. However when I upload it to the live server I get the message "Page Cannot be Displayed" whenever I hit the SUBMIT button.
Here are the relevant code snippits:
Input page:
<html>
<body>
<form action="submit.php" method="post">
<fieldset><legend>Title</legend><input name="title" type="text" size="60"></fieldset><br>
<fieldset><legend>Body Text</legend><textarea name="body" cols="60" rows="15"></textarea></fieldset><br>
<input type="submit" name="Submit" value="Submit Update">
<input type="reset" name="Reset" value="Reset Form">
</form>
</body>
</html>
submit.php:
<html>
<body>
<?php
// Replacing carriage returns
$body = preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $body);
if(is_writable('notice.txt'))
{
$fp = fopen('notice.txt','w');
$content = "$title||$body\n";
fwrite($fp,$content);
fclose($fp);
echo'Notices page has been updated';
}
else
{
echo'File is not writable';
}
?>
</body>
</html>
My guess is that PHP hasn't been installed on the live server.