-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserviceinsert.php
54 lines (46 loc) · 1.4 KB
/
serviceinsert.php
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
<?php
$host = "localhost"; //database host server
$db = "fritter"; //database name
$user = "root"; //database user
$pass = ""; //password
$connection = mysql_connect($host, $user, $pass);
//Check to see if we can connect to the server
/*
$x = $_GET['x'];
$y = $_GET['y'];
$z = $_GET['z'];
*/
$user_name = $_POST['user_name'];
$user_email = $_POST['user_email'];
$user_pass = $_POST['user_pass'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$birthday = $_POST['birthday'];
$city = $_POST['city'];
$credit_card = $_POST['credit_card'];
$ccv = $_POST['ccv'];
if(!$connection)
{
die("Database server connection failed.");
}
else
{
//Attempt to select the database
$dbconnect = mysql_select_db("fritter", $connection);
//Check to see if we could select the database
if(!$dbconnect)
{
die("Unable to connect to the specified database!");
}
else
{
$query = "INSERT INTO users(user_name,user_email,user_pass,first_name,last_name,birthday,city,credit_card,ccv)
VALUES('$user_name' ,'$user_email','$user_pass','$first_name','$last_name','$birthday','$city','$credit_card','$ccv')";
$resultset = mysql_query($query, $connection);
$response = "Successfully added " . $query;
//echo "Successfully added ";
//echo $query;
}
echo json_encode($response);
}
?>