edrew04 Posted January 19, 2009 Share Posted January 19, 2009 Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in C:\xampp\htdocs\xampp\cardano\Project_News\news.class.php on line 23 That pain in the brain:"T_PAAMAYIM_NEKUDOTAYIM"! I can't locate where is my error in my code help me please here is the code: <?php class news{ var $newDir = 'news'; var $newsList; var $newsCount = -1; function getNewsList(){ $this->newsList = array(); //Open the actual directory if($handle=@opendir($this->newsDir)){ //read all file from the actual directory while($file=readdir($handle)){ if(!is_dir($file)) { $this->newsList[]=$file; } } } rsort($this->newsList); return $this->newsList; } function displayNews(){ $list=$this->getNewsList(); echo "<table class='newsList'>"; foreach ($list as value){ $newsData=file($this->newsDir.DIRECTORY_SEPARATOR.$value); $newsTitle = $newsData[0]; $submitDate = $newsData[1]; unset($newsData['0']); unset($newsData['1']); $newsContent=""; foreach($newsData as $value){ $newsContent.=$value; } echo "<tr><th align='left'>$newsTitle</th>"; echo "<tr><td colspan='2'>".$newsContent."<br/></td></tr>"; echo "<th class='right'>$submitDate</th></tr>"; } echo"</table>"; if(sizeOf($list)==0){ echo "<center><p>no news at the moment!</p><p> </p></center>"; } function displayAddForm(){ ?> <script language = "javascript" type = "text/javascript" src = "js/tiny_mce.js"></script> <script language = "javascript" type = "text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", theme_advanced_buttons3 : "", theme_advanced_toolbar_align : "center", theme_advanced_toolbar_location : "top", }); </script> <form class = "iform" action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "post"> News title : <br/> <input type ="text" name ="title" size = "40" /><br/><br/> Content : <br/> <textarea name = "newstext" rows = "15" cols = "67"></textarea><br/> <center><input type = "submit" name = "submit" value = "save"></center> </form> <?php } function insertNews(){ $newsTitle = isset($_POST['title']) ? $_POST['title'] : 'Untitled'; $submitDate = date('YmdHis'); $newsContent = isset($_POST['newstext']) ? $_POST['newstext']:'No Content'; if(!file_exists($this->newsDir)){ mkdir($this->newsDir); } $f = fopen($this->newsDir.DIRECTORY_SEPARATOR.$filename.".txt","w+"); fwrite($f,$newsTitle."\n"); fwrite($f,$submitDate."\n"); fwrite($f,$newsContent."\n"); fclose($f); header('Location:index.php'); } } ?> [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
ratcateme Posted January 19, 2009 Share Posted January 19, 2009 recheck the vars on line 23 you are missing a $ Scott. Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted January 19, 2009 Share Posted January 19, 2009 yup wat ratcateme said.... what language is this T_PAAMAYIM_NEKUDOTAYIM? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted January 19, 2009 Share Posted January 19, 2009 See http://en.wikipedia.org/wiki/Paamayim_Nekudotayim for an explanation. Ken Quote Link to comment Share on other sites More sharing options...
ratcateme Posted January 19, 2009 Share Posted January 19, 2009 strange never would have guessed that i just found the error had no clue what the message ment Scott. Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted January 19, 2009 Share Posted January 19, 2009 yeah i was expecting some translation from english (which is kinda what this is) of semicolon or some other operator or what is it, ENCAPSED WHITESPACE Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.