Hello all,
I have just finished my first real attempt to create something usefull with PHP. I am looking for reviews of the code to see if anyone has any ideas on how to improve the way things are done in it.
The program is something that allows someone that doesn't know how to edit any type of code to add an announcement to a news page.
Any help is appreciated. Thanks,
jkerlin
Here is the script processing page:
<?php
$NewsData[0] = '<br>';
$NewsData[1] = $_POST['NewNewsTitle'];
$NewsData[2] = $_POST['NewNewsBody'];
$gdate = getdate(time());
$tstamp = date('m-d-Y');
$FileInfo = <<<FINFO
$NewsData[0]
<h3>*$tstamp: $NewsData[1]</h3>
<p>$NewsData[2]</p>
$NewsData[0]
\n
FINFO;
$filename = 'c:\progra~1\apache~1\apache2\htdocs\news.inc';
$fp = fopen($filename, "a") or die("Cannot open file $filename");
fwrite($fp, $FileInfo);
fclose($fp);
?>
<html>
<head>
<title>Add News Complete</title>
</head>
<body>
<h1>Add News Complete</h1>
<hr>
<br><br>
<?php include_once("$filename"); ?>
</body>
</html>