Posted by Anonymous Sat 24th Mar 2007 06:06 - Syntax is PHP - 144 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
  1.  
  2. if(isset($_POST['add']))
  3. {
  4.   $title = $_POST['title'];
  5.   $content_news = $_POST['content_news'];
  6.   $forward_link = $_POST['forward_link'];
  7.  
  8.   $res = mysql_query("INSERT INTO news (title, content_news, forward_link)
  9.     VALUES ('" . $title . "',  '". $content_news ."',  '". $forward_link ."')");
  10.  
  11.   if ( !$res )
  12.   {
  13.     echo("SQL Error: ". mysql_error());
  14.   }
  15. }
  16.  
  17. if(isset($_POST['delete']))
  18. {
  19. mysql_query("delete from news where id='". $id ."'");
  20. }
  21.  
  22. $query="SELECT * FROM news";
  23. $result=mysql_query($query);
  24. $num=mysql_numrows($result);
  25.  
  26.  
  27. mysql_close($dbh);
  28.  
  29. ?>