Esempio n. 1
0
<?php

include "../config.php";
//print_r($_REQUEST);
if ($_REQUEST['insert'] == 1) {
    $sql1 = "insert into c_likes (MovieID,UserIPAddress,AddDate) value('" . $_REQUEST['movie_id'] . "','" . $_SERVER['REMOTE_ADDR'] . "','" . DateFormatDB(date('Y-m-d H:i:s')) . "')";
    $res1 = mysql_query($sql1);
}
$sql_like_count = "select * from c_likes where MovieID IN (SELECT MovieID FROM b_movies WHERE Title = (SELECT Title FROM b_movies WHERE MovieID=" . $_REQUEST['movie_id'] . "))";
$res_like_count = mysql_query($sql_like_count);
if (mysql_num_rows($res_like_count) > 0) {
    echo mysql_num_rows($res_like_count);
} else {
    echo 'No';
}
Esempio n. 2
0
    case 2:
        $message .= "<span class=\"errormsg\">" . $error_msg . "</span>";
        break;
}
?>

        <?php 
if ($_GET['a'] == 'n') {
    $InsertCheck = 3;
}
if (isset($_POST['btnSubmit1']) && !empty($_POST['txtEmail1'])) {
    $InsertData['txtName1'] = DoSecure($_POST['txtName1']);
    $InsertData['txtEmail1'] = DoSecure($_POST['txtEmail1']);
    $InsertData['txtCable'] = DoSecure($_POST['txtCable']) != 'Cable Operator :' ? DoSecure($_POST['txtCable']) : '';
    $InsertData['userIPAddress'] = $_SERVER["REMOTE_ADDR"];
    $InsertData['addDate'] = DateFormatDB(date("Y-m-d H:i:s"));
    $InsertData['VerificationCode'] = date('YmdHis') . rand('10000', '99999');
    ///////////////////////////////////////////Server side validation for Newsletter/////////////////////////////////////
    $error_msg1 = '';
    if ($InsertData['txtName1'] == 'Name :' || $InsertData['txtName1'] == '') {
        $error_msg1 .= "Please enter your name.<br>";
    }
    if ($InsertData['txtEmail1'] == 'Email :' || $InsertData['txtEmail1'] == '') {
        $error_msg1 .= "Please enter your email.<br>";
    }
    if (!ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $InsertData['txtEmail1'])) {
        $error_msg1 .= "Please enter a valid email" . "<br>";
    }
    $isusernameactive = mysql_num_rows(mysql_query("SELECT * FROM f_newsletter WHERE userEmail='" . $InsertData['txtEmail1'] . "' AND isDeleted=0 AND Verified=1"));
    //echo $isusernameactive;
    if ($InsertData['txtEmail1'] != 'Email :' && $InsertData['txtEmail1'] != '' && ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $InsertData['txtEmail1']) && $isusernameactive > 0) {
Esempio n. 3
0
    $response = file_get_contents($token_url);
    $params = null;
    parse_str($response, $params);
    $access_token = $params['access_token'];
    $access_token2 = file_get_contents($token_url);
    $graph_url2 = "https://graph.facebook.com/me?" . $access_token2;
    $user = json_decode(file_get_contents($graph_url2));
    //print_r($user);
    if ($access_token2) {
        $sql_checkin = "select * from fb_users where fbuserid='" . $user->id . "'";
        $res_checkin = mysql_query($sql_checkin);
        if (mysql_num_rows($res_checkin) > 0) {
            $sql = "UPDATE fb_users \n\t\t\tset\n\t\t\tisdelete = 1,\n\t\t\tupdatedate = '" . DateFormatDB(date('Y-m-d H:i:s')) . "'\n\t\t\twhere fbuserid='" . $user->id . "' and isdelete=0";
            mysql_query($sql);
        }
        $sql = "INSERT INTO fb_users (`fbuserid`,  `name`, `first_name`, `last_name`, `gender`, `email`, `link`, `username`, `useripaddress`, `adddate`)\n\t\t VALUES ('" . $user->id . "', '" . $user->name . "', '" . $user->first_name . "', '" . $user->last_name . "', '" . $user->gender . "', '" . $user->email . "', '" . $user->link . "', '" . $user->username . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . DateFormatDB(date('Y-m-d H:i:s')) . "')";
        mysql_query($sql);
        //header("location:../logedin.php");
        session_start();
        $_SESSION['fbusername'] = $user->name;
        $_SESSION['fbuserid'] = $user->id;
    }
    ?>
<script>top.location.href='../logedin.php'</script>

		<?php 
}
?>

<!-- initializing FB SDK starts -->
<div id="fb-root"></div>
Esempio n. 4
0
    $InsertData['verificationcode'] = DoSecure($_GET['vcode']);
    ///////////////////////////////////////////Server side validation /////////////////////////////////////
    $error_msg = '';
    if ($InsertData['email'] == '') {
        $error_msg .= "Email missing.<br>";
    }
    if ($InsertData['verificationcode'] == '') {
        $error_msg .= "Verification code missing.<br>";
    }
    if ($error_msg == '') {
        $ins_sql = "Select * from f_newsletter where userEmail='" . $InsertData['email'] . "' and md5(VerificationCode)='" . $InsertData['verificationcode'] . "' and isDeleted=0 and Verified=0";
        //echo $ins_sql;
        $res_ins = mysql_query($ins_sql);
        if (mysql_num_rows($res_ins) == 1) {
            $VerificationCheck = 1;
            $upd_sql = "Update f_newsletter set Verified=1, VerificationFromIP='" . $_SERVER["REMOTE_ADDR"] . "', VerifiedOnDate='" . DateFormatDB(date("Y-m-d H:i:s")) . "' where userEmail='" . $InsertData['email'] . "' and md5(VerificationCode)='" . $InsertData['verificationcode'] . "'";
            $res_sql = mysql_query($upd_sql);
            if (mysql_affected_rows()) {
                include "verificationsuccessemail.php";
            }
        } else {
            $VerificationCheck = 3;
        }
    } else {
        $VerificationCheck = 2;
    }
}
$message = '';
switch ($VerificationCheck) {
    case 1:
        $message .= "<span class='successmsg'>Thank you for your confirmation.</span>";