<?php
mysql_connect("localhost", "****", "****") or die(mysql_error());
mysql_select_db("****") or die(mysql_error());
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
if ($pass != $info['password'])
{
}
else
{
header("Location: members.php");
}
}
}
if (isset($_POST['submit'])) {
if(!$_POST['username'] | !$_POST['pass']) {
die('
<HTML>
<BODY bgcolor="#000000" text="#FF0000" link="#FF0000" vlink="#FF0000">
<DIV style="position:absolute;left:230px;top:105px;width:596px;height:90px;z-index:0" align="left">
<FONT style="font-size:64px;BACKGROUND-COLOR:#282828" color="#00FF00" face="Comic Sans MS">Не сте попълнили </FONT>
</DIV>
<DIV style="position:absolute;left:268px;top:196px;width:535px;height:90px;z-index:1" align="left">
<FONT style="font-size:64px;BACKGROUND-COLOR:#282828" color="#00FF00" face="Comic Sans MS">нужните полета !</FONT>
</DIV>
<DIV style="position:absolute;left:468px;top:354px;width:150px;height:67px;z-index:2" align="left">
<FONT style="font-size:48px" color="#FF0000" face="Comic Sans MS"><a href="login.php">Назад</a></FONT>
</DIV>
</BODY>
</HTML>');
}
if (!get_magic_quotes_gpc()) {
$_POST['email'] = addslashes($_POST['email']);
}
$check = mysql_query("SELECT * FROM users WHERE username = '".$_POST['username']."'")or die(mysql_error());
$check2 = mysql_num_rows($check);
if ($check2 == 0) {
die('<HTML>
<BODY bgcolor="#000000" text="#FF0000" link="#00FF00" vlink="#00FF00" alink="#00FF00">
<DIV style="position:absolute;left:279px;top:55px;width:525px;height:67px;z-index:0" align="left">
<FONT style="font-size:48px" color="#FF0000" face="Comic Sans MS">Потребител с такова </FONT>
</DIV>
<DIV style="position:absolute;left:296px;top:121px;width:487px;height:67px;z-index:1" align="left">
<FONT style="font-size:48px" color="#FF0000" face="Comic Sans MS">име на съществува !</FONT>
</DIV>
<DIV style="position:absolute;left:323px;top:242px;width:402px;height:38px;z-index:2" align="left">
<FONT style="font-size:27px" color="#00FF00" face="Comic Sans MS">Ако нямате регистрация може </FONT>
</DIV>
<DIV style="position:absolute;left:376px;top:279px;width:298px;height:38px;z-index:3" align="left">
<FONT style="font-size:27px" color="#00FF00" face="Comic Sans MS">да се регистрирате от</FONT>
</DIV>
<DIV style="position:absolute;left:488px;top:325px;width:67px;height:38px;z-index:4" align="left">
<FONT style="font-size:27px" color="#00FF00" face="Comic Sans MS"><a href="register.php">ТУК</a></FONT>
</DIV>
<DIV style="position:absolute;left:455px;top:408px;width:150px;height:67px;z-index:5" align="left">
<FONT style="font-size:48px" color="#FF0000" face="Comic Sans MS"><a href="login.php">Назад</a></FONT>
</DIV>
</BODY>
</HTML>');
}
while($info = mysql_fetch_array( $check ))
{
$_POST['pass'] = stripslashes($_POST['pass']);
$info['password'] = stripslashes($info['password']);
$_POST['pass'] = md5($_POST['pass']);
if ($_POST['pass'] != $info['password']) {
die('
<HTML>
<BODY bgcolor="#000000" text="#FF0000" link="#00FF00" vlink="#00FF00" alink="#00FF00">
<DIV style="position:absolute;left:181px;top:61px;width:701px;height:67px;z-index:0" align="left">
<FONT style="font-size:48px" color="#FF0000" face="Comic Sans MS">Грешна парола,опитайте пак!</FONT>
</DIV>
<DIV style="position:absolute;left:323px;top:242px;width:402px;height:38px;z-index:1" align="left">
<FONT style="font-size:27px" color="#00FF00" face="Comic Sans MS">Ако нямате регистрация може </FONT>
</DIV>
<DIV style="position:absolute;left:376px;top:279px;width:298px;height:38px;z-index:2" align="left">
<FONT style="font-size:27px" color="#00FF00" face="Comic Sans MS">да се регистрирате от</FONT>
</DIV>
<DIV style="position:absolute;left:488px;top:325px;width:67px;height:38px;z-index:3" align="left">
<FONT style="font-size:27px" color="#00FF00" face="Comic Sans MS"><a href="register.php">ТУК</a></FONT>
</DIV>
<DIV style="position:absolute;left:455px;top:408px;width:150px;height:67px;z-index:4" align="left">
<FONT style="font-size:48px" color="#FF0000" face="Comic Sans MS"><a href="login.php">Назад</a></FONT>
</DIV>
</BODY>
</HTML>');
}
else
{
$_POST['username'] = stripslashes($_POST['username']);
$hour = time() + 3600;
setcookie(ID_my_site, $_POST['username'], $hour);
setcookie(Key_my_site, $_POST['pass'], $hour);
header("Location: members.php");
}
}
}
else
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<HTML>
<HEAD>
<BODY bgcolor="#000000" text="#FF0000" vlink="#0000FF" alink="#0000FF">
<DIV style="position:absolute;left:355px;top:16px;width:315px;height:135px;z-index:0" align="left">
<FONT style="font-size:96px;BACKGROUND-COLOR:#282828" color="#FF0000" face="Comic Sans MS">ВХОД</FONT>
</DIV>
<DIV style="position:absolute;left:363px;top:237px;width:106px;height:19px;z-index:1" align="left">
<FONT style="font-size:16px" color="#00FF00" face="Arial"><B>Потребител:</B></FONT>
</DIV>
<DIV style="position:absolute;left:399px;top:278px;width:71px;height:19px;z-index:2" align="left">
<FONT style="font-size:16px" color="#00FF00" face="Arial"><B>Парола:</B></FONT>
</DIV>
<INPUT type="text" style="position:absolute;left:487px;top:237px;width:144px;background-color:#000000;color:#FF0000;z-index:4" size="18" name="username">
<INPUT type="password" style="position:absolute;left:487px;top:278px;width:144px;background-color:#000000;color:#FF0000;z-index:3" size="18" name="pass">
<DIV style="position:absolute;left:464px;top:322px;width:107px;height:40px;z-index:8" align="center">
<BUTTON type="submit" name="submit" style="width:107px;height:40px;background-color:#000000"><P><FONT style="font-size:27px" color="#00FF00" face="Comic Sans MS">ВХОД</FONT></P></BUTTON>
</DIV>
<DIV style="position:absolute;left:371px;top:386px;width:298px;height:24px;z-index:5" align="left">
<FONT style="font-size:21px;BACKGROUND-COLOR:#282828" color="#0000FF" face="Arial">Ако нямате регистрация може </FONT>
</DIV>
<DIV style="position:absolute;left:410px;top:410px;width:223px;height:24px;z-index:6" align="left">
<FONT style="font-size:21px;BACKGROUND-COLOR:#282828" color="#0000FF" face="Arial">да се регистрирате от</FONT>
</DIV>
<DIV style="position:absolute;left:497px;top:440px;width:44px;height:24px;z-index:7" align="left">
<FONT style="font-size:21px;BACKGROUND-COLOR:#282828" color="#0000FF" face="Arial"><a href="register.php">ТУК</a></FONT>
</DIV>
</BODY>
</HTML>
<?php
}
?>