?? addblock.php
字號:
<?
include_once("logincheck.php");
include_once("myconnect.php");
if(!get_magic_quotes_gpc())
{
$username=str_replace("$","\$",addslashes($_REQUEST["username"]));
$email=str_replace("$","\$",addslashes($_REQUEST["email"]));
$description=str_replace("$","\$",addslashes($_REQUEST["description"]));
}
else
{
$username=str_replace("$","\$",$_REQUEST["username"]);
$email=str_replace("$","\$",$_REQUEST["email"]);
$description=str_replace("$","\$",$_REQUEST["description"]);
}
/*if ($_SESSION["sbbleads_memtype"]=="3" )
{
$msg1="You donot have access to block users. To get this access please consider upgrading your membership" ;
}
else*/
{
if (($_REQUEST["radio"]==1) && (!isset($_REQUEST["username"]) || ($_REQUEST["username"]=="")) )
{
$msg1="Please specify the Member ID of the user to add him/her to the block list";
}
elseif (($_REQUEST["radio"]==2) && (!isset($_REQUEST["email"]) || ($_REQUEST["email"]=="")) )
{
$msg1="Please specify Email ID of the user to add him/her to the block list";
}
elseif (($_REQUEST["radio"]==3) && ($_REQUEST["country"]=="") )
{
$msg1="Please choose country to add users to the block list";
}
else
{
if($_REQUEST["radio"]==1)
{
if (isset($_REQUEST["username"]) && ($_REQUEST["username"]==$_SESSION["sbbleads_username"]))
{
$msg1="You cannot add yourself to your block list" ;
}
else
{
$rs=mysql_query("Select * from sbbleads_members where sb_username ='$username'" );
if ($rs=mysql_fetch_array($rs))
{
$rs1=mysql_query("Select * from sbbleads_blocked where sb_uid =" .$_SESSION["sbbleads_userid"] ." and sb_blocked_id=" . $rs["sb_id"] );
if ($rs1=mysql_fetch_array($rs1))
{
$msg1="User is already in your block list" ;
}
else
{
mysql_query("insert into sbbleads_blocked (sb_uid,sb_blocked_id,sb_desc)
VALUES(" . $_SESSION["sbbleads_userid"] ."," . $rs["sb_id"] .",'$description')");
$msg1="User has been added to your block list" ;
} ///User already in contact list
}
else
{
$msg1="No user with such username exists" ;
} //Username cannot be found
}//not to yourself in block list
}// if radio=1
if($_REQUEST["radio"]==2)
{
$check_query="Select * from sbbleads_members where sb_email='$email' and sb_id=".$_SESSION["sbbleads_username"];
$mem=mysql_fetch_array(mysql_query($check_query));
if ($mem)
{
$msg1="You cannot add yourself to your block list" ;
}
else
{
$rs=mysql_query("Select * from sbbleads_members where sb_email ='$email'" );
if ($rs=mysql_fetch_array($rs))
{
$rs1=mysql_query("Select * from sbbleads_blocked where
sb_uid =" .$_SESSION["sbbleads_userid"] ." and sb_blocked_id=" . $rs["sb_id"] );
if ($rs1=mysql_fetch_array($rs1))
{
$msg1="User is already in your block list" ;
}
else
{
mysql_query("insert into sbbleads_blocked (sb_uid,sb_blocked_id,sb_desc)
VALUES(" . $_SESSION["sbbleads_userid"] ."," . $rs["sb_id"] .",'$description')");
$msg1="User has been added to your block list" ;
} ///User already in contact list
}
else
{
$msg1="No user with such email exists" ;
} //Username cannot be found
}//can't add urself
}//end if radio=2
if($_REQUEST["radio"]==3)
{
$rs_q=mysql_query("Select * from sbbleads_blocked_countries where
sb_uid=" .$_SESSION["sbbleads_userid"] ." and sb_blocked_id=" . $_REQUEST["country"] );
if (!($rs1=mysql_fetch_array($rs_q)))
{
mysql_query("insert into sbbleads_blocked_countries (sb_uid,sb_blocked_id,sb_desc)
VALUES(".$_SESSION["sbbleads_userid"].",". $_REQUEST["country"] .",'$description')");
$msg1="Country have been added to the block list";
} ///User already in contact list
else
{
$msg1="Country is already in block list";
}
}// end of radio=3
}
}
header("Location: ". "contact_confirm_mem.php?block=1&errmsg=" . urlencode($msg1) );
die();
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -