-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseller_profile_save.php
More file actions
29 lines (26 loc) · 1.05 KB
/
Copy pathseller_profile_save.php
File metadata and controls
29 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
session_start();
require_once "conn.php";
if (!isset($_SESSION["seller_id"])) {
echo "<script>alert('Login to use our services');";
echo "window.location.href = 'selleronastra.html';</script>";
exit(); // Stop execution
} else {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$user_id = $_SESSION["seller_id"];
$store_name = $_POST['store_name'];
$store_description = $_POST['storedesc'];
$alternative_phone_number = $_POST["alternative_phone_number"];
$sql = "UPDATE seller_profile SET store_name=?, store_description=?, alt_ph_no=? WHERE UID=?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ssii", $store_name, $store_description, $alternative_phone_number, $user_id);
if ($stmt->execute()) {
echo "<script>alert('Profile updated successfully');";
echo "window.location.href = 'seller_profile.php';</script>";
exit();
} else {
echo "Error updating profile: " . $conn->error;
}
}
}
?>