note 119612 deleted from function.move-uploaded-file by cmb
| From: | cmb@php.net | Date: | Sat, 16 Jul 2016 02:51:19 +0000 |
| Subject: | note 119612 deleted from function.move-uploaded-file by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206039@lists.php.net to get a copy of this message | ||
Note Submitter: dhirendralmsl at gmail dot com
----
<?php // for udating data comes in table
if(isset($_POST['update'])){
$update_id=$_GET['edit_form']; // get variable created in above form edit_form
$name=$_POST['name'];
$staff_id=$_POST['staff_id'];
$address=$_POST['address'];
$qualification=$_POST['qualification'];
$designation=$_POST['designation'];
$level=$_POST['level'];
$subject=$_POST['subject'];
$contact_no=$_POST['contact_no'];
$email_id=$_POST['email_id'];
$image=$_FILES['image']['name'];
/*$image=$_FILES['image']['name'];
$image_type=$_FILES['image']['type'];
$image_size=$_FILES['image']['size'];
$image_tmp=$_FILES['image']['tmp_name'];
move_uploaded_file($image_tmp,"../images/$image") ;*/
if($_FILES['image']['name']!='')
{
$file='../images/'.$row['image'];
@unlink($file);
$image_tmp=$_FILES['image']['tmp_name'];
$image=$_FILES['image']['name'];
$fileUpload = move_uploaded_file($image_tmp,"../images/".$image);
}
else
{
$image="../images/".$image_name;
}
$update_query="update staff_info set
staff_id='$staff_id',name='$name',designation='$designation',
address='$address',
qualification='$qualification',level='$level',subject='$subject',
contact_no='$contact_no',email_id='$email_id',image='$image' where
id='$update_id'";
if(mysql_query($update_query)){
echo"<script>window.open('index.php?updated=Post has been updated
sucessfully','_self')</script>";
}
}
?>