hey people . please tell me how to solve this thing . i dont want to see this error again . please tell me . here is the error :


Parse error: syntax error, unexpected $end in /home/awah7870/public_html/cms/blog_prog.php on line 26

and here is the code

<?php
if(isset($_POST['post']))
{
$title = $_POST['title'];
$post = $_POST['post'];
$time = date(d-m-y);
mysql_connect('localhost','awah_awah','awah') or die("cant connect to the server").mysql_error();
  mysql_select_db("awah_admin") or die("cant select hte database ").mysql_error();
$sql = mysql_query("INSERT INTO blog ('title','post','datetime') VALUES ('$title','$post','$time')");
if(!$sql)
{
echo "error: cant insert the values --> ".mysql_error();
}
else
{
echo "done";
}
mysql_close();`
}
?>
<?php
if(isset($_POST['post']))
{
$title = $_POST['title'];
$post = $_POST['post'];
$time = date("d-m-y");
mysql_connect('localhost','awah_awah','awah') or die("cant connect to the server".mysql_error() );
  mysql_select_db("awah_admin") or die("can't select hte database " .mysql_error() );
$sql = mysql_query("INSERT INTO blog ('title','post','datetime') VALUES ('$title','$post','$time')");
if(!$sql)
{
echo "error: can't insert the values --> ".mysql_error();
}
else
{
echo "done";
}
mysql_close();` //get rid of this extra "garbage" character you have here
}
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.