-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.php
More file actions
39 lines (32 loc) · 778 Bytes
/
add.php
File metadata and controls
39 lines (32 loc) · 778 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
<?php
session_start();
$ID=$_GET["ID"];
if(strpos("$ID"," "))
{
$_SESSION["check"] = 2;
header("Location: createlocation.php");
exit();
}
$servername = "localhost";
$username = "id2398881_tusharsinghal";
$password = "mayanktushar";
$dbname = "id2398881_jaibharat";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO indians (ID)
VALUES ('$ID')";
if ($conn->query($sql) === TRUE) {
$_SESSION["ID"] = $ID;
$_SESSION["check"] = 0;
} else {
$_SESSION["check"] = 1;
header("Location: createlocation.php");
exit();
}
header("Location:addermap.php"); /* Redirect browser */
$conn->close();
?>