I have been struggling with this problem for days. I have done everything in my power to find the answer but can't seem to figure it out. I want to parse the information from a form into my database, but I keep getting errors. The error apparently is on line 27 in this php parse code.
<?php
/* Created by Adam Khoury @ [url]www.developphp.com[/url] */
// You may want to obtain refering site name that this post came from for security purposes here
// exit the script if it is not from your site and script
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$pid = $_POST['id'];
$pagetitle = $_POST['pagetitle'];
$author = $_POST["author_id"];
$keywords = $_POST["keywords"];
$description = $_POST["description"];
$pagebody = $_POST['pagebody'];
// Filter Function -------------------------------------------------------------------
function filterFunction ($var) {
$var = nl2br(htmlspecialchars($var));
$var = eregi_replace("'", "'", $var);
$var = eregi_replace("`", "'", $var);
return $var;
}
$pagetitle = filterFunction($pagetitle);
$author = filterFunction($author);
$keywords = filterFunction($keywords);
$description = filterFunction($description);
// End Filter Function --------------------------------------------------------------
include_once "scripts/connect_to_mysql.php";
// Add the updated info into the database table
$query = mysqli_query($myConnection, "UPDATE pages SET pagetitle='$pagetitle', author_id='$author', keywords='$keywords', description='$description', pagebody='$pagebody', lastmodified='now()' WHERE id='$pid'") or die (mysqli_error($myConnection)); // <--- line 27 here
echo 'Operation Completed Successfully! <br /><br /><a href="my_articles.php">Click Here</a>';
exit();
?>
I place the code in question in bold letters. Please help. This is getting frustrating.