PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<?php
require "inc/connection.php";
if(isset($_POST["edit_user"])){
// echo var_dump($_POST);
//upload to forder
$target_dir = "uploads/user/";
$basename= basename($_FILES["passport"]["name"]);
$upload_file = $target_dir.$basename;
$imageFileType = strtolower(pathinfo($upload_file,PATHINFO_EXTENSION));
$uploadOk = "1";
// //Check if file already exists
// if (file_exists($upload_file)) {
// echo "
// <script>
// alert('Image already exit, select another passport.');
// </script>";
// $uploadOk = 0;
// }
//check file size
if ($_FILES["passport"]["size"] > 954675) {
echo "
<script>
alert('Sorry, your file is too large.');
document .location.href= 'users-profile.php';
</script>";
$uploadOk = "0";
}
//check file type
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg") {
echo "
<script>
alert('Sorry, only JPG, JPEG, PNG files are allowed.');
document .location.href= 'users-profile.php';
</script>";
$uploadOk = "0";
}
//check final status
if ( $uploadOk == "0") {
//if everything is ok, try to upload file
$uploadOk = "1";
} else {
//move to folder
$move = move_uploaded_file($_FILES["passport"]["tmp_name"], $upload_file);
// check if moved
if(isset($move)){
$info =$_POST["about"];
$brand =$_POST["brand"];
$country =$_POST["country"];
$address =$_POST["address"];
$phone =$_POST["phone"];
$email =$_POST["email"];
$address =$_POST["address"];
$job =$_POST["job"];
$name =$_POST["fullName"];
$id =$_POST["id"];
$sql="UPDATE `user` SET `name` = '$name', `email` = '$email', `job` = '$job',`image` = '$upload_file', `location` = '$address', `phone_number` =
'$phone', `bio` = '$info', `country` = '$country ', `brand` = '$brand ' WHERE `id` = '$id'" ;
$query= mysqli_query($connection, $sql);
if($query){
echo "<script>
alert('Profile uploaded successfuly,');
document .location.href= 'users-profile.php';
</script>";
} else {
echo "<script>
alert('Opp! an Error occur');
</script>";
}
}
}
}
?>
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E