-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkEmail.php
27 lines (22 loc) · 760 Bytes
/
checkEmail.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
<?php
session_start();
include_once "./adoConnection.php";
$returnData = array();
$returnData[ "message" ] = "";
$returnData[ "code" ] = -1;
//------------------------------------------------------------------------------
if ( isset( $_POST[ "email" ] ) ) $email = $_POST[ "email" ]; // retrieve data
$sql = "select email from remind_user where email = ?";
$sql = $conn->prepare( $sql );
$result = $conn->execute( $sql , $email );
if ( $result->EOF ) {
$returnData[ "code" ] = 0;
$returnData[ "message" ] = "";
}
else {
$returnData[ "code" ] = 1;
$returnData[ "message" ] = "電子郵件已被使用!!";
}
echo json_encode( $returnData );
$conn->close();
?>