N
Nik Saprano
Вот вообщем код с моими изменениями:
Почему то не работает.
Хелп, плиз!!!
Код:
<?
session_start();
include "affconfig.php";
include "lang/$language";
if ($_POST['userid']!='' && $_POST['password']!='')
{
// protection against script injection
$userid = preg_replace('/[^a-zA-Z0-9@._]/', '', $_POST['userid']);
$password = preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['password']);
// if the user has just tried to log in
$db_conn = mysql_connect($server, $db_user, $db_pass) or die ("Database CONNECT Error (line 11)");
mysql_select_db($database, $db_conn);
$query = "select * from affiliates where email='$userid' and pass='$password'";
$result = mysql_query($query, $db_conn);
$id = mysql_fetch_array($result);
if (mysql_num_rows($result) > 0)
{
mail("$_POST['userid']","Your password",
"Your password:$password");
echo "Send.";
}
else{echo"Ошибка";}
exit;
}
if(aff_check_security())
{
aff_redirect('members_only.php');
exit;
}
else
{
if (isset($_POST['userid']))
{
// if they've tried and failed to log in
echo AFF_I_CANNOTLOG;
}
// else
// {
// they have not tried to log in yet or have logged out
// echo AFF_I_NOTLOGGED;
// }
// provide form to log in
?>
Хелп, плиз!!!