示例#1
0
文件: signup.php 项目: Gameonn/ganger
     $name = $_FILES['photo']['name'];
     $size = $_FILES['photo']['size'];
     $tmp = $_FILES['photo']['tmp_name'];
     $ext = getExtension($name);
     $actual_image_name = $image_name;
     if ($s3->putObjectFile($tmp, $bucket, $actual_image_name, S3::ACL_PUBLIC_READ)) {
         $status = 1;
         //$success='1';
         //$msg = "Upload Successful.";
         //$s3file='http://'.$bucket.'.s3.amazonaws.com/'.$actual_image_name;
     } else {
         $status = 0;
     }
     //$msg = "Upload Fail.";
 }
 $v_code = DataClass::generateRandomString();
 $sql = "select * from users where phone_number=:phone";
 $sth = $conn->prepare($sql);
 $sth->bindValue("phone", $phone);
 try {
     $sth->execute();
 } catch (Exception $e) {
     //echo $e->getMessage();
 }
 $result = $sth->fetchAll(PDO::FETCH_ASSOC);
 if (count($result)) {
     $success = "1";
     $msg = "Phone Number already taken";
     $phn_status = 1;
     $body = "Verification Code for Gander is " . $v_code;
     try {
示例#2
0
require_once '../PHPMailer_5.2.4/class.phpmailer.php';
require_once "DataClass.php";
$success = $msg = "0";
$data = array();
// +-----------------------------------+
// + STEP 2: get data				   +
// +-----------------------------------+
$email = $_REQUEST['email'];
$kid = $_REQUEST['kid_id'];
$uid = $_REQUEST['user_id'];
if (!($kid && $email)) {
    $success = "0";
    $msg = "Incomplete Parameters";
    $data = array();
} else {
    $code = DataClass::generateRandomString(12);
    $sql = "SELECT kids.id as kid_id from users join kids on kids.user_id=users.id WHERE email=:email";
    $sth = $conn->prepare($sql);
    $sth->bindValue('email', $email);
    try {
        $sth->execute();
    } catch (Exception $e) {
    }
    $res = $sth->fetchAll();
    if (count($res)) {
        foreach ($res as $key => $value) {
            $sql = "select * from friends where kid_id1=:kid1 and kid_id2=:kid2 \n\t\t\t  UNION\n\t\t\t  select * from friends where kid_id1=:kid2 and kid_id2=:kid1";
            $sth = $conn->prepare($sql);
            $sth->bindValue('kid1', $kid);
            $sth->bindValue('kid2', $value['kid_id']);
            try {