Als je inlogt logt ie soms wel goed in, soms niet, ligt aan je cookies denk ik..
Hier me login:
PHP
<?php /* ------------------------- */
include("config.php");
function quote_smart($value) {
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
if(version_compare(phpversion(),"4.3.0") == "-1") {
return mysql_escape_string($value);
} else {
return mysql_real_escape_string($value);
}
}
if(isset($_POST['login'],$_POST['pass'])) {
$dbres = mysql_query("SELECT `login`,`activated` FROM `[users]` WHERE `login`='{$_POST['login']}' AND `pass`=('{$_POST['pass']}')");
if(($data = mysql_fetch_object($dbres)) && $data->activated == 1) {
$validate = (rand(0,1000));
setcookie("login",$data->login,time()+60*60*24,"/",".crimewar2004.com");
setcookie("validate",$validate,time()+60*60*24,"/",".crimewar2004.com");
mysql_query("REPLACE INTO `[online]`(`time`,`login`,`IP`,`validate`) values(NOW(),'{$_SERVER['REMOTE_ADDR']}','{$data->login}','$validate')");
$_SESSION['login'] = $data->login;
$_SESSION['IP'] = $_SERVER['REMOTE_ADDR'];
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`signup`) AS `signup` FROM `[users]` WHERE `login`='{$_SESSION['login']}'");
$_SESSION['data'] = mysql_fetch_object($dbres);
}
}
else if($_GET['x'] == "logout") {
mysql_query("DELETE FROM `[online]` WHERE `login`='{$_COOKIE['login']}' AND `validate`='{$_COOKIE['validate']}' AND `IP`='{$_SERVER['REMOTE_ADDR']}'");
setcookie("login",'',time()-24*60*60,"/","");
setcookie("validate",'',time()-24*60*60,"/","");
unset($_SESSION['login']);
unset($_SESSION['IP']);
unset($_SESSION['data']);
}
$login = mysql_real_escape_string($_POST['login']);
/* ------------------------- */ ?>
<html>
<?
require("banned.php");
?>
<head>
</head>
<body>
<table align="center" width=100%>
<?php /* ------------------------- */
if($_GET['x'] == "logout")
print " \n <tr>Je bent nu uitgelogd\n <script language=\"javascript\">setTimeout('parent.window.location.reload()',500)</script></td></tr>\n";
else if($_GET['x'] == "lostpass") {
print " <tr><td class=\"subTitle\"><b>Wachtwoord vergeten</b></td></tr>\n";
if(isset($_GET['id'],$_GET['code'])) {
$dbres = mysql_query("SELECT `login` FROM `[temp]` WHERE `id`='{$_GET['id']}' AND `code`='{$_GET['code']}' AND `area`='lostpass'");
if($data = mysql_fetch_object($dbres)) {
$dbres = mysql_query("SELECT `login`,`email` FROM `[users]` WHERE `login`='{$data->login}'");
$data = mysql_fetch_object($dbres);
$newpass = rand(100000,999999);
mysql_query("UPDATE `[users]` SET `pass`=('$newpass') WHERE `login`='{$data->login}'");
mysql_query("DELETE FROM `[temp]` WHERE `id`='{$_GET['id']}'");
mail($data->email,"Criminals password","Je wachtwoord is gereset, je kan nu inloggen met: $newpass","From: Criminals <[email protected]>\n");
print " <tr>Je nieuwe wachtwoord is ge-emailed naar {$data->email}</td></tr>\n";
}
}
else if(isset($_POST['email'],$_POST['login'])) {
$dbres = mysql_query("SELECT `login`,`email` FROM `[users]` WHERE `login`='{$_POST['login']}' AND `email`='{$_POST['email']}'AND `activated`=1");
if($data = mysql_fetch_object($dbres)) {
$code = rand(100000,999999);
mysql_query("INSERT INTO `[temp]`(`login`,`code`,`area`,`time`) values('{$data->login}',$code,'lostpass',NOW())");
$id = mysql_insert_id();
mail($data->email,"Criminals password","Er is een aanvraag binnengekomen om je wachtwoord te resetten. Als jij dit niet hebt aangevraagd, negeer deze email dan. Heb jij dit wel gedaan, klik dan op deze link:\nhttp://www.criminalsx.nl/login.php?x=lostpass&id=$id&code=$code","From: Criminalsx.nl <[email protected]>");
print " <tr>Er is een email gestuurd naar {$data->email} met verdere instructies</td></tr>\n";
}
else
print " <tr>Er is geen gebruiker met die login en e-mail</td></tr>\n";
}
print <<<ENDHTML
<tr><td class="mainTxt" align="center"><br>
<form method="post"><table>
<tr><td class='inhoud'>Login:</td> <td><input type="text" name="login"></td></tr>
<tr><td class='inhoud'>E-Mail:<td> <td><input type="text" name="email"></td></tr>
<tr><td></td> <td align="right"><input type="submit" value="Ok" style="width: 100"></td></tr>
</form></table></td></tr>
ENDHTML;
}
else if($data) {
if($data->activated == 0)
print " <tr>Je account is nog niet geactiveerd</td></tr>\n";
else
print " \n <tr><font size=2>Welkom {$data->login} veel plezier.\n <a href=\"nav.php\">Klik hier om door te gaan</font></a>\n </td></tr>\n";
}
else {
print " \n";
if(isset($_POST['login'],$_POST['pass']))
print " \n";
print <<<ENDHTML
<tr>
<form method="post"><table align="center">
<tr><td class='inhoud'>Loginnaam:</td> <td><input type="text" name="login" maxlength=16 style="width: 150;"></td></tr>
<tr><td class='inhoud'>Wachtwoord:</td> <td><input type="password" name="pass" maxlength=16 style="width: 150;"></td></tr>
<tr><td></td><td align="right"><input type="submit" name="submit" style="width: 100;" value="Login"></td></tr>
</table></form>
</td></tr>
<tr><td class="mainTxt" align="center"><a href="?p=login&x=lostpass">Wachtwoord vergeten?</a></td></tr>
ENDHTML;
}
/* ------------------------- */ ?>
</table>
</body>
</html>
Toon Meer
Me nav.php:
PHP
<?php /* ------------------------- */
if(isset($_COOKIE['login'],$_COOKIE['validate'])) {
setcookie("login",$_COOKIE['login'],time()+24*60*60,"/","");
setcookie("validate",$_COOKIE['validate'],time()+24*60*60,"/","");
}
include("_include-config.php");
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
if($data->level == -1){
print"<table width=100%><tr><td class=maintxt>Je bent Verbannen!</td></tr></table>";
die();
}
if ($data->rank <= 9){
if ($data->rankvord >= 100.00){
mysql_query("UPDATE `[users]` SET `rank`=`rank`+1,`rankvord`='0.00' WHERE `login`='{$data->login}'");
print "";
}
}
mysql_query("UPDATE `[users]` SET `moordexp1`=(100+(`rank`*'50')) WHERE `login`='{$data->login}'");
print"";
/* ------------------------- */ ?>
<LINK REL="StyleSheet" HREF="style/style.css" TYPE="text/css">
<style>BODY { height: 100%; background: #4f1060 url('bg.gif') repeat-x; margin: 0px; padding: 0px }</style>
<title>HipHopperz.nl! - Wordt een bekende rapper op het net!</title>
<?php
include_once 'header.php';
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
if ( isset($_GET['p'] ) )
{
$p = $_GET['p'];
$file = "content/$p.php";
if ( file_exists($file) )
{
include_once($file);
include_once 'footer.php';
}
else
{
include_once 'content/home.php';
}
}
else
{
include_once 'content/home.php';
}
include_once 'footer.php';
?>
Toon Meer