Server IP : 50.63.8.133 / Your IP : 3.134.118.113 Web Server : Microsoft-IIS/10.0 System : Windows NT P3NWVPWEB032 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : IWPD_10999(xformtec) ( 0) PHP Version : 5.4.45 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : G:/PleskVhosts/xform.in/madhurivivah.com/member/ |
Upload File : |
Current File : G:/PleskVhosts/xform.in/madhurivivah.com/member/edit-profile-photo.php |
<?php
if (isset($_POST['update6'])) {
$imgfile = $_FILES["profile_photo"]["name"];
// get the image extension
$extension = substr($imgfile, strlen($imgfile) - 4, strlen($imgfile));
// allowed extensions
$allowed_extensions = array(".jpg", "jpeg", ".png", ".gif");
// Validation for allowed extensions .in_array() function searches an array for a specific value.
if (!in_array($extension, $allowed_extensions)) {
echo "<script>alert('Invalid format. Only jpg / jpeg/ png /gif format allowed');</script>";
} else {
//rename the image file
$imgnewfile = md5($imgfile) . $extension;
// Code for move image into directory
move_uploaded_file($_FILES["profile_photo"]["tmp_name"], "../admin/img/profile-photos/" . $imgfile);
if (isset($_SESSION['member_profile_id']) && $_SESSION['member_profile_id'] != '') {
$sql1 = "UPDATE member_profile SET profile_photo='$imgfile' WHERE member_profile_id='" . $_SESSION['member_profile_id'] . "'";
if (mysqli_query($con, $sql1)) {
//echo "Records inserted successfully.";
{
echo "<script>
alert('Profile Updated Successfully..!!!');
</script>";
}
} else {
$ermsg = "Either Email ID or Password is Incorrect..!";
}
//if ($query) {
//$msg = " Your Personal Information updated ";
// } else {
//$error = "Something went wrong . Please try again.";
// }
}
}
}
?>
<p> <?php echo htmlentities($ermsg); ?></p>
<table class="table table-bordered">
<tbody>
<tr>
<td>Add New Your Profile Picture :-
</td>
<td>
<img src="../admin/img/profile-photos/<?php echo $row['profile_photo'] ?>" alt="">
<input type="file" name="profile_photo" class="form-control" required></input> </td>
</tr>
</tbody>
</table>
<div class="save-stngs pd2">
<ul>
<button class="btn btn-primary" name="update6" type="submit"><b>Update Personal Information</b></button>
</ul>
</div>