if (!empty($h1) || !empty($h2) || !empty($h3) || !empty($fileupload))
{
$date_add=date("Y-m-d");
include "connect.php";
$sql="insert into tb_news values('','$h1','$h2','$h3','','$date_add')";
$result=mysql_db_query($dbname,$sql);
if ($fileupload)
{
$array_last=explode(".",$fileupload_name);
$c=count($array_last)-1;
$lastname=strtolower($array_last[$c]);
if($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg")
{
$sql2="select max(id_news) from tb_news";
$result2=mysql_db_query($dbname,$sql2);
$row=mysql_fetch_row($result2);
$photoname=$row[0].".".$lastname;
copy($fileupload,"photonews/ ".$photoname);
$sql3="update tb_news set photo_news='$photoname' where id_news='$row[0]' ";
$result3=mysql_db_query($dbname,$sql3);