%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/public_html/website_93b53270/ |
Upload File : |
<?php
include 'config.php';
$id = $_POST['id'];
$name = $_POST['name'];
$email = $_POST['email'];
$picture = $_POST['picture'];
$phone = $_POST['phone'];
$imgData = file_get_contents($picture);
if ($imgData !== false) {
$profile_img_name = $id . '.jpg';
$savePath = 'images/Upload/user/' . $profile_img_name;
file_put_contents($savePath, $imgData);
}
$get_user = mysqli_query($conn, "SELECT `user_id` FROM `user_tbl` WHERE `user_id`='$id'");
if(mysqli_num_rows($get_user) > 0){
$_SESSION['user_id'] = $id;
$update = mysqli_query($conn, "UPDATE `user_tbl` SET `name`='$name',`email`='$email',`phone`='$phone',`image1`='".$profile_img_name."' WHERE `user_id`='$id'");
}
else{
$insert = mysqli_query($conn, "INSERT INTO `user_tbl`(`user_id`,`name`,`email`,`phone`,`image1`) VALUES('$id','$name','$email','$phone','".$profile_img_name."')");
if($insert){
$_SESSION['user_id'] = $id;
}
else{
echo "Sign up failed! (Something went wrong).";
}
}
?>