-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android Studio / PHP / JSON / Application
- Loading branch information
0 parents
commit 4d2c9b1
Showing
169 changed files
with
12,917 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
require_once 'include/DB_Functions.php'; | ||
$db = new DB_Functions(); | ||
|
||
// json response array | ||
$response = array("error" => FALSE); | ||
|
||
if (isset($_POST['email_check'])) | ||
{ | ||
$email = $_POST['email_check']; | ||
|
||
|
||
// get the user by email | ||
if ($db->isCheckEmail($email)) | ||
{ | ||
// user already existed | ||
$response["error"] = TRUE; | ||
$response["error_msg"] = true; | ||
$response["error_position"] = 1; | ||
echo json_encode($response); | ||
}else{ | ||
$user = $db->isCheckEmail($email); | ||
if($user){ | ||
$response["user"]["email"] = $user["_email"]; | ||
$response["error"] = false; | ||
$response["error_msg"] = false; | ||
$response["error_position"] = 2; | ||
echo json_encode($response); | ||
}else{ | ||
$response["error"] = TRUE; | ||
$response["error_msg"] = false; | ||
$response["error_position"] = 3; | ||
echo json_encode($response); | ||
} | ||
} | ||
}else{ | ||
// required post params is missing | ||
$response["error"] = TRUE; | ||
$response["error_msg"] = false; | ||
$response["error_position"] = 4; | ||
|
||
echo json_encode($response); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
$con = mysqli_connect("localhost","id2558345_root", "korea0504", "id2558345_kiki"); | ||
|
||
|
||
|
||
$result = mysqli_query($con, "select * from vendor_advertisement where _number"); | ||
$response = array(); | ||
|
||
|
||
$i=0; | ||
while($row = mysqli_fetch_array($result)){ | ||
array_push($response, array("_number_check$i"=>$row[0])); | ||
$i++; | ||
} | ||
|
||
echo json_encode(array("response"=>$response)); | ||
mysqli_close($con); | ||
|
||
?> | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
require_once 'include/DB_Functions.php'; | ||
$db = new DB_Functions(); | ||
|
||
$_email = $_POST["_email"]; | ||
|
||
$statement = mysqli_prepare($conn, "select * from vendor_info where _email = ?"); | ||
mysqli_stmt_bind_param($statement, "s", $_email); | ||
mysqli_stmt_execute($statement); | ||
mysqli_stmt_store_result($statement); | ||
mysqli_stmt_bind_result($statement, $_email); | ||
|
||
$response = array(); | ||
$response["success"] = true; | ||
|
||
while(mysqli_stmt_fetch($statement)){ | ||
$response["success"] = false; | ||
$response["_email"] = $_email; | ||
} | ||
|
||
echo json_encode($response); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
$con = mysqli_connect("localhost","id2558345_root", "korea0504", "id2558345_kiki"); | ||
//$con = mysqli_connect("localhost","root", "1234", "kiki"); | ||
|
||
|
||
$Name = $_GET['_number']; | ||
|
||
$result = mysqli_query($con, "select title_image from vendor_product_info where _number = '$Name'"); | ||
|
||
$response = array(); | ||
|
||
|
||
while($row = mysqli_fetch_array($result)){ | ||
array_push($response, array("title_image"=>$row[0])); | ||
} | ||
|
||
echo json_encode(array("response"=>$response)); | ||
mysqli_close($con); | ||
|
||
?> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
/** | ||
* Database config variables | ||
*/ | ||
define("DB_HOST", "localhost"); | ||
define("DB_USER", "id2558345_root"); | ||
define("DB_PASSWORD", "korea0504"); | ||
define("DB_DATABASE", "id2558345_kiki"); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* @author Ravi Tamada | ||
* @link http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ Complete tutorial | ||
*/ | ||
|
||
class DB_Connect { | ||
private $conn; | ||
|
||
// Connecting to database | ||
public function connect() { | ||
require_once 'include/Config.php'; | ||
|
||
// Connecting to mysql database | ||
$this->conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE); | ||
|
||
// return database handler | ||
return $this->conn; | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.