<?php
	session_start();
	include('dbcon.php');
	
if($_POST['id'])
{
  $banner_id=$_POST['id'];
  
$image = rand(1000,100000)."-".$_FILES['image1']['name'];
$res="select image from `home_banner` where id='$banner_id'";
$rs=mysqli_query($con,$res);
$row=mysqli_fetch_assoc($rs);
$count=$row['image'];
//echo $image;
//exit();

move_uploaded_file($_FILES['image1']['tmp_name'],$count);  
  
  $title1=htmlspecialchars($_POST['title1'], ENT_QUOTES);
  $title2=htmlspecialchars($_POST['title2'], ENT_QUOTES);
  
  $query="update `home_banner` set  image='$count',content1='$title1',content2='$title2' where id=$banner_id";
  $r=mysqli_query($con, $query);

    if($r>0)
{
   header("location:banner.php?message=success1");
} 
} 





?>