All pastes #175384 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-09-18 19:10 UTC
rendered paste body
<?php 
if(isset($_POST['update']))
{
   $title = $_POST['title'];
   $content = $_POST['content'];
   $author = $_POST['author'];

   if(!get_magic_quotes_gpc())
   {
      $title   = addslashes($title);
      $content = addslashes($content);
	  $author = addslashes($author);
   }

include '../../includes/db_connect.php';

// update the article in the database
  $query = " INSERT INTO news (title, content, author) ".
            " VALUES ('$title', '$content', '$author', NOW())";
   mysql_query($query) or die('Error ,query failed');

   
   echo "<div id='notice'><div class='title'>News Article Added!</div>" .
"<p class='notice'>Your news article submission was successful! </p>" .
"<p class='notice'><a href='www.djjoop.com/admin_cp/index.php'>Back To Admin CP</a></p></div>";
}


mysql_close();

?>