Here's the error i'm getting : Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/hellkrea/public_html/version3/site/news.php on line 34 Here's the news.php page :
<? function News() { if (!isset($_GET['do'])) { $local_file = 'news.nfo'; $file = fopen($local_file , 'r') or die("Couldn't open first place"); while (!(feof($file))) { $news[] = fgets($file, 1000); //Slap each line upto 1000 chars into an array } $servertime = time(); echo date("H:i:s, d M, Y", $servertime) . "rn<br>"; $numitems = count($news); echo "Count : $numitems<br>rn"; for($x=0; $x < $numitems; $x++) { echo $news[$x] . "<br>"; } echo "<a href=" . $_SERVER['PHP_SELF'] . "?do=new>Add News</a>n"; fclose($file); } elseif ($_GET['do'] == "new") { echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . "?do=add">n" . "Author<br>" . // THIS WOULD BE LINE 34. '<input type="text" size="15" name="author"><br>' . "News to add :<br>n" . '<textarea rows="20" cols="60" name="new_news">' . '</textarea><br>' . '<input type="submit" name="submit" value="Add News"><br>' . '</form>'; } elseif ($_GET['do'] == "add") { $time = time(); $read_time = date("H:i:s, d M, Y", $time); $unstripped_news = $_POST['new_news']; $new_news = stripslashes($unstripped_news); $author = $_POST['author']; $fpnews = fopen('news.nfo', 'r'); $old_content = fread($fpnews, filesize('news.nfo')); $fp = fopen('news.nfo', 'w'); fwrite($fp, "rn$timern$authorrn$new_newsrn$old_content", (strlen($time) + strlen($new_news) + strlen($author) + strlen($old_content) + 16)); echo "News added successfully. Here is what you posted.<br>n" . "Submitted on $read_time<br>n" . "By : $author <br>n" . "News : <br> n$new_news <br> n"; echo "Back to <a href=" . $_SERVER['PHP_SELF'] . ">news</a>"; fclose($fpnews); fclose($fp); } echo "n<br>n<a href=" . "/news.php" . "s>View my Source!</a>"; echo "n<br>n blah blah blah <a href=news.nfo>news.nfo<a/> : " . filesize('news.nfo'); } ?>
Thanks for u help