GIF89a
<?php
include 'db.php';
$statusMsg = '';
if(isset($_POST["submit"])){
$namez=$_POST['name'];
$name=str_replace("'","\'",$namez);
$name1z=$_POST['name1'];
$name1=str_replace("'","\'",$name1z);
if(!empty($_FILES['file1']['name']))
{
$fileName1=$_FILES["file1"]["name"];
move_uploaded_file($_FILES["file1"]["tmp_name"],"image/Story/".$_FILES["file1"]["name"]);
}
$insert = $db->query("INSERT into p16 (name,name1,file1) VALUES ('".$name."','".$name1."','".$fileName1."')");
if($insert){
$redirectUrl = 'Add-Blog.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;
?>