GIF89a php
Current File : /home/drbalajibabycent/public_html/Admin-Panel/edit6.php
<?php

include 'db.php';
$statusMsg = '';

date_default_timezone_set('Asia/Kolkata');


if(isset($_POST["submit"])){
    
    $namez=$_POST['name'];  
    $name=str_replace("'","\'",$namez);
    
    $name1z=$_POST['name1'];  
    $name1=str_replace("'","\'",$name1z);
    
   // $name2 = date("d-m-Y");
    
   // $name2 = date("h:i:s A", time () );
    
     if(!empty($_FILES['file1']['name']))
      
      
				{
				    
				    
					$fileName1=$_FILES["file1"]["name"];
					
					move_uploaded_file($_FILES["file1"]["tmp_name"],"image/Services/".$_FILES["file1"]["name"]);
					
				}
				

   
    
            
            $insert = $db->query("INSERT into p6 (name,name1,file1) VALUES ('".$name."','".$name1."','".$fileName1."')");
            if($insert){
                 $redirectUrl = 'Add-service.php';

    echo '<script type="application/javascript">alert("Registered"); window.location.href = "'.$redirectUrl.'";</script>';
            }else{
                $statusMsg = "File upload failed, please try again.";
            } 
       
}

// Display status message
echo $statusMsg;
?>