Example #1
0
{
    var regex = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    return regex.test(email);
}
function exsitEmail(email)
{
	var ajax = new Ajax();
	ajax.send("../data/service.php?t=1","email="+email,null,"POST",false);
	return parseInt(Xml.First($T(ajax.req.responseXML,"result").item(0),"num"))!=0;
}
</script>
</head>
<body> 
<?php 
if ($_POST['tbEmail'] != '') {
    $email = GetSafeStr($_POST['tbEmail']);
    if ($email == $_SESSION['useremail']) {
        $strResult = "<span class='red'>You Cound NOT Add Yourself As a Contact</span>";
    } else {
        $toid = GetUserIdByEmail($email);
        if ($DB->getOne("select count(*) from userfriend where userid=" . $_SESSION["userid"] . " and friendid=" . $toid, true) > 0) {
            $strResult = "<span class='red'>This Contact Has Been In Your List</span>";
        } else {
            $DB->Query("insert into usersysmsg (fromid,toid,msgcontent,typeid,msgaddtime) values ('" . $_SESSION["userid"] . "','" . $toid . "','" . $_SESSION["useremail"] . "','7','" . toDay . "')");
            $strResult = "Request Rent Successfully";
        }
    }
    ?>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="70" align="center"><?php 
Example #2
0
<?php

require '../data/function.php';
$strEmail = GetSafeStr($_POST["tbEmail"]);
$strPass = GetSafeStr($_POST["tbPass"]);
$strNick = GetSafeStr($_POST["tbNick"]);
$strSign = GetSafeStr($_POST["tbSign"]);
$intGender = $_POST["rdGender"];
$file = $_FILES['fileFace'];
if ($strEmail == "" || $strPass == "" || $strNick == "") {
    $regResult = "Sorry, Registration Failed";
    $regInfo = "You Personal Profile Is NOT Integrated";
} else {
    if ($file['name'] == '') {
        $strFace = "default.gif";
    } else {
        $picExt = $file['type'];
        if ($picExt != 'image/gif' && $picExt != 'image/pjpeg' && $picExt != 'image/jpeg' && $picExt != 'image/png' && $picExt != 'image/x-png') {
            $strFace = "default.gif";
        } else {
            $ext = substr($file['name'], strrpos($file['name'], '.'));
            $str = '';
            for ($i = 0; $i < 9; $i++) {
                $str .= mt_rand(0, 9);
            }
            $strFace = time() . $str . '.' . $ext;
            move_uploaded_file($file['tmp_name'], '../userface/' . $strFace);
        }
    }
    $sql = "select * from usernum where isok = 1 order by id limit 0,1";
    $oRs = $DB->getOne($sql);