www
/
wwwroot
/
magazinmiorita.be
/
clientarea
➕ New
📤 Upload
✎ Editing:
profile.php
← Back
<?php include('../includes/inc.config.php'); include('../header.php'); include('check_session.php'); $regions_results = array(); $regions = $database->execute(" SELECT * FROM `region` "); while($row = $database->fetch($regions)){ $regions_results[] = $row; } if(isset($_POST['update_ship'])){ $ship_zip = $database->sanitize($_POST['ship_zip']); $ship_city = $database->sanitize($_POST['ship_city']); $ship_address = $database->sanitize($_POST['ship_address']); $update_shipping = $database->execute("UPDATE `customers` SET `ship_address` = '$ship_address', `ship_zip` = '$ship_zip', `ship_city` = '$ship_city', `region` = '$region' WHERE `id` = '".$user_id."' "); } if(isset($_POST['update_pro'])){ if(isset($_POST['password']) && $_POST['password'] != ''){ $password = "`password` = '".md5($_POST['password'])."', "; $epassword = "`epassword` = '".$data->encrypt($_POST['password'])."', "; }else{ $password = ''; } $email = $database->sanitize($_POST['email']); $fname = $database->sanitize($_POST['fname']); $lname = $database->sanitize($_POST['lname']); $username = $database->sanitize($_POST['username']); $company = $database->sanitize($_POST['company']); $address = $database->sanitize($_POST['address']); $zip = $database->sanitize($_POST['zip']); $city = $database->sanitize($_POST['city']); $region = $database->sanitize($_POST['region']); $phone = $database->sanitize($_POST['phone']); $random_salt = $data->random_key(12); if($password){ $salt = "`salt` = '".$random_salt."', "; $punbb_pass = "`password` = '".sha1($random_salt.sha1($_POST['password']))."', "; }else{ $salt = ''; $punbb_pass = ''; } $update_profile = $database->execute("UPDATE `customers` SET `email` = '$email', $password $epassword `fname` = '$fname', `lname` = '$lname', `username` = '$username', `company` = '$company', `address` = '$address', `zip` = '$zip', `city` = '$city', `region` = '$region', `phone` = '$phone' WHERE `id` = '".$user_id."' "); $update_forum = mysqli_query($con, "update users set $punbb_pass $salt `username` = '$username', `email` = '$email' where site_id = '$user_id'"); } if($update_profile || $update_shipping){ $message = 'Profile updated successfully!'; $_SESSION['message'] = $message; $_SESSION['mess_type'] = 'success'; header('Location: profile.php'); exit; } $smarty->assign("regions", $regions_results); $smarty->display(CLIENT_PATH.'profile.tpl'); ?>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel