-
Notifications
You must be signed in to change notification settings - Fork 0
/
loginajaxsubmit.php
26 lines (21 loc) · 938 Bytes
/
loginajaxsubmit.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
<?php
$host = "databaseinstance.cmpvv7vrynza.us-west-2.rds.amazonaws.com";
$user = "arregoitiaJ1";
$pass = "Iamiamiam123";
$databaseName = "earthlinks";
$tableName = "Users";
//--------------------------------------------------------------------------
// 1) Connect to mysql database
//--------------------------------------------------------------------------
include 'DB.php';
$con = mysql_connect($host,$user,$pass);
$dbs = mysql_select_db($databaseName, $con);
//--------------------------------------------------------------------------
// 2) Post data to database
//--------------------------------------------------------------------------
$userID = mysql_escape_string($_POST['userID']);
$userName = $_POST['userName'];
$query = mysql_query("insert into $tableName(FBID, Name) values ('$userID', '$userName')");
echo "User added successfully";
mysql_close($con); // Connection Closed
?>