-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmobilereq.php
More file actions
88 lines (66 loc) · 2 KB
/
mobilereq.php
File metadata and controls
88 lines (66 loc) · 2 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
session_start();
if($_SERVER['REQUEST_METHOD'] == "POST"){
if(empty($_POST['brand']) ){
include('newmobileform.php');
exit();
}
/*else if(empty($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
include('booksreqform.php');
exit();
}
else if(empty($_POST["form"])) {
include('gamesreqform.php');
exit();
}
else if(empty($_POST["mob"])) {
include('gamesreqform.php');
exit();
}
else if(empty($_POST["price"])) {
include('gamesreqform.php');
exit();
}
else if(empty($_POST["type"])) {
include('gamesreqform.php');
exit();
}
else if(empty($_POST["cond"])) {
include('gamesreqform.php');
exit();
} */
else {
$id=$_SESSION['userid'];
$brand=$_POST['brand'];
$model=$_POST['model'];
$email=$_POST['email'];
$mob=$_POST['mob'];
$imgpath=$_POST['imgpath'];
$cond=$_POST['cond'];
$type=$_POST['type'];
$price=$_POST['price'];
$email=$_POST['email'];
$imgpath=$_POST['imgpath'];
$yop=$_POST['yop'];
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "eztrade";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO accessories (uid,price,type,cond,brand,model,phone,email,imgpath,yop)
VALUES ('$id',$price,'$type','$cond','$brand','$model',$mob,'$email','$imgpath',$yop)";
if ($conn->query($sql) === TRUE) {
$_SESSION['uniqueAcce']=$model;
header('Location: afterADAccc.php');
} else {
echo "Error: Record already exists" . $sql . "<br>" . $conn->error;
}
$conn->close();
}
}
?>