image inserted in directory folder not in database? please see the code, the image can be viewed in the folder but not in database the pc.gif is inserted instead on the command else the filename is executed on the command but the else is executed? the first command is proper why the second command is executed instead.
if($action=="insertproject"){
if ($_FILES['logo']['name'] != "") {
$imageInfo = getimagesize($_FILES['logo']['tmp_name']); // get image size
$width = $imageInfo[0]; // image width
$height = $imageInfo[1]; // image height
if($height > 2000 || $width > 2000){
echo "<script> alert('Image is to big! Try to resize the picture!') </script>";
exit;
} // check size
$newimg1 = date("YmdHis").".jpg"; // set name for new image
$newimg2 = date("YmdHis").".pdf"; // set name for pdf if is necesary
if(stristr($_SERVER['OS'],"win")){
$path = "prodimg/";
} // determin path of image folder
elseif(stristr($_SERVER['OS'],"linux")){
$path = str_replace("admin.php","",$_SERVER['SCRIPT_FILENAME']) . "prodimg/";
}
else {
$path = "prodimg/";
}
move_uploaded_file ( $_FILES['logo']['tmp_name'], $path . $newimg1 );
} // copy image in image folder
else{
$newimg1="pc.gif";
} // if is not posible than set image name as pc.gif
$serviceid = $_POST['serviceid'];
$projectcode = $_POST['projectcode'];
$projecttitle = $_POST['projecttitle'];
$update = $_POST['update'];
$projectstatus = $_POST['projectstatus'];
$progress = "on progress";
$sector = $_POST['sector'];
$dateofrtecreview = $_POST['dateofrtecreview'];
$dateapprovedatrpmolevel = $_POST['dateapprovedatrpmolevel'];
$dateendorsedtonpmo = $_POST['dateendorsedtonpmo'];
$dateapprovednpmo = $_POST['dateapprovednpmo'];
$datereceivedbyrpmo = $_POST['datereceivedbyrpmo'];
$expectedoutput = $_POST['expectedoutput'];
$yearassistancereceived = $_POST['yearassistancereceived'];
$setupinvestment = $_POST['setupinvestment'];
$beneficiaryinvestment = $_POST['beneficiaryinvestment'];
$projectdescription = $_POST['projectdescription'];
$res = mysql_query("insert into appointment_detail(`serviceid`,`picture`,`projectdescription`,`dateofrtecreview`,`dateapprovedatrpmol evel`,`dateendorsedtonpmo`,`dateapprovednpmo`,`datereceivedbyrpmo`,`expectedoutput`,`projectcode`,`projecttitle`,`update`,`status`,`projectstatus`,`sector`,`setupinvestment`,`beneficiaryinvestment`)
values('$serviceid','$newimg1','$projectdescription','$dateofrtecreview','$dateapprovedatrpmolevel',' $dateendorsedtonpmo','$dateapprovednpmo','$datereceivedbyrpmo','$expectedoutput','$projectcode','$pro jecttitle','$update','$progress','$projectstatus','$sector','$setupinvestment','$beneficiaryinvestmen t')");
echo "<script>location.replace('admin.php?action=showallprojects')</script>";
}