[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit-profile.php
<?php include("header.php"); ?> <!-- // Header include --> <!-- Inner Banner --> <!-- <div class="inner-banner"> <div class="container"> <h4>Edit Profile</h4> <ul> <li><a href="index.php">Home</a></li> <li><i class="fa-solid fa-angles-right"></i></li> <li>Edit Profile</li> </ul> </div> </div>--> <div class="profile"> <div class="container"> <h2>Edit Profile</h2> <div class="row"> <div class="col-md-3"> <?php include("user.php"); ?> </div> <div class="col-md-9"> <div class="profile-blog"> <form method="post"> <div class="input-group"> <label>Name:</label> <input type="text" name="name" value="<?=$uname?>" placeholder="Name" readonly> </div> <div class="input-group"> <label>E-mail id:</label> <input type="text" title="Click for Edit" name="email" id="email" value="<?=$uemail?>"> </div> <div class="input-group"> <label>Mobile No.:</label> <input type="text" id="phn" name="phone" name="phone" value="<?=$uphone?>" placeholder="Mobile No" > </div> <div class="input-group"> <label>Pincode:</label> <input type="text" name="pincode" placeholder="Pincode" value="<?=$upincode?>" > </div> <div class="input-group"> <label>State:</label> <select id="state" name="state" > <option value="">State</option> <?php $table1='state_list'; $stmt1=$show->readAll($table1); $num1=$stmt1->rowCount(); if($num1>0){ while($row1=$stmt1->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row1['state']."'";if($ustate==$row1['state']) echo "selected"; echo ">".$row1['state']."</option>"; } } ?> </select> </div> <div class="input-group"> <label>City</label> <input type="text" placeholder="city" value="<?=$ucity?>" name="city"> </div> <div class="input-group"> <label>Address:</label> <textarea name="address"><?=$uaddress?></textarea> </div> <div class="input-edit"> <input type="submit" name="update" value="Edit"> </div> </form> <?php if(isset($_POST['update'])){ $allowed = ["address","state","city","pincode","phone","email"]; $params = []; $setStr = ""; foreach ($allowed as $key) { if (isset($_POST[$key]) && $key != "uid") { $setStr .= "`$key` = :$key,"; $params[$key] = htmlspecialchars(strip_tags($_POST[$key])); } } $setStr = rtrim($setStr, ","); $params['user_id'] =$_SESSION['user_id']; $show->table ='user'; $show->cols =$setStr; $show->id_name ='user_id'; //print_r($params); $show->params =$params; if($show->update_all()){ echo '<script> setTimeout(function() { swal({ title: "Thank You ", text: "Your profile has been updated", type: "success" }, function() { window.location = "'.$_SERVER['REQUEST_URI'].'"; }); }, 1000); </script>'; }else{ echo "Something went wrong"; } }?> </div> <h2>Password</h2> <div class="profile-blog"> <form class="profile" action="" method="post"> <div class="input-group"> <label for="password">New Password :</label> <input type="password" placeholder="New Password" id="reg_pass" name="password" required=""> </div> <div class="input-group"> <label for="com-password">Confirm Password :</label> <input type="password" placeholder="Confirm Password" onkeyup="check()" id="reg_confirm_pass" name="password" required=""> <div id="message"></div> </div> <input type="submit" id="pass_up" class="green_button" name="update_pass" value="Update" /> </form> <?php if(isset($_POST['update_pass'])){ $sq="update user set password='".htmlentities(strip_tags(md5($_POST['password'])))."' where user_id='".$_SESSION['user_id']."'"; $stmt=$con->prepare($sq); if($stmt->execute()){ echo "<script>alert('Password has been changed. Please login again to continue');window.location.href='logout.php';</script>"; } }?> </div> </div> </div> </div> </div> <!-- Footer include --> <?php include("footer.php"); ?> <!-- // Footer include -->
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 692.47 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619