-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathseller-registration.php
More file actions
41 lines (32 loc) · 1004 Bytes
/
Copy pathseller-registration.php
File metadata and controls
41 lines (32 loc) · 1004 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
<?php
session_start();
if (empty($_SESSION['email'])) {
header('location:seller-home.php');
} else {
$email = $_SESSION['email'];
$userpassword = $_SESSION['password'];
$servername = "localhost";
$username = "root";
$password = "PASSWORD";
$dbname = "fullcashback";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully" . "<br>";
$sql = "INSERT INTO sellers (email, password)
VALUES ('$email', '$userpassword')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully" . "<br>";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
//Close the connection
mysqli_close($conn);
setcookie("seller-email", $_SESSION['email'], time() + (86400 * 30), "/");
setcookie("seller-password", $_SESSION['password'], time() + (86400 * 30), "/");
header('location:seller-dashboard.php');
}
?>