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

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

if(isset($_POST["submit"])){
    
    $namez=$_POST['name'];  
    $name=str_replace("'","\'",$namez);
   
     if(!empty($_FILES['file1']['name']))
      
      
				{
				    
				    
					$fileName1=$_FILES["file1"]["name"];
					
					move_uploaded_file($_FILES["file1"]["tmp_name"],"image/Material/".$_FILES["file1"]["name"]);
					
				}
				

   
    
            
            $insert = $db->query("INSERT into p15 (name,file1) VALUES ('".$name."','".$fileName1."')");
            if($insert){
                 $redirectUrl = 'Add-Material.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;
?>