-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect1.php
More file actions
30 lines (23 loc) · 1.09 KB
/
select1.php
File metadata and controls
30 lines (23 loc) · 1.09 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
<?php
$link = mysqli_connect("localhost", "root", "", "tap");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// Escape user inputs for security
setcookie('name', mysqli_real_escape_string($link, $_REQUEST['name']), time() + (86400 * 30), "/");
setcookie('email', mysqli_real_escape_string($link, $_REQUEST['email']), time() + (86400 * 30), "/");
setcookie('phone', mysqli_real_escape_string($link, $_REQUEST['phone']), time() + (86400 * 30), "/");
setcookie('city', mysqli_real_escape_string($link, $_REQUEST['city']), time() + (86400 * 30), "/");
header("Location:selection2.php");
// $name = mysqli_real_escape_string($link, $_REQUEST['email']);
// $email = mysqli_real_escape_string($link, $_REQUEST['email']);
// $phone = mysqli_real_escape_string($link, $_REQUEST['phone']);
// $city = mysqli_real_escape_string($link, $_REQUEST['city']);
// if(mysqli_query($link, $sql)){
// echo "Records added successfully.";
// } else{
// echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
// }
mysqli_close($link);
?>