i have been using this code in creating blog
i'm getting this error on exectute(array($title,$entry); line
the error is
Notice: Undefined variable: title in D:\xampp\htdocs\simple_blog\inc\update.inc.php on line 14
Notice: Undefined variable: entry in D:\xampp\htdocs\simple_blog\inc\update.inc.php on line 14
can any one please help me out.
<?php
if($_SERVER['REQUEST_METHOD']=='POST'
&& $_POST['submit'] =='Save Entry'
&& !empty($_POST['title'])
&& !empty($_POST['entry'])
)
{
include_once 'db.inc.php';
$db= new PDO(DB_INFO,DB_USER,DB_PASS);
$sql="INSERT INTO entries (title,entry) VALUES(?,?)";
$stmt= $db->prepare($sql);
$stmt->execute(array($title,$entry));
$stmt->closeCursor();
}
else
{
header('Location: ../admin.php');
exit;
}