Onbekend |
|
Hey, ik heb een probleempje met mijn login.php telkens als ik inlog, verschijnt er "je wordt ingelogd" maar als hij dan op 100% staat gaat hij niet naar de volgende pagina: index-v1.php zou hij dan moeten gaan.
Dit is mijn login.php
<?php /* ------------------------- */
include("_include-config.php");
if(isset($_POST['login'],$_POST['pass'])) {
$dbres = mysql_query("SELECT `login`,`activated` FROM `[users]` WHERE `login`='{$_POST['login']}' AND `pass`=MD5('{$_POST['pass']}')");
if(($data = mysql_fetch_object($dbres)) && $data->activated == 1) {
$validate = md5(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']);
}
/* ------------------------- */ ?>
<html>
<head>
<title><--counter terrors--></title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
</head>
<body style="background: #996600; margin: 0px;">
<table align="center" width=100%>
<?php /* ------------------------- */
if($_GET['x'] == "logout")
print " <tr><td class=\"subTitle\"><b>Login</b></td></tr>\n <tr><td class=\"mainTxt\">Je bent nu uitgelogd\n <script language=\"javascript\">setTimeout('parent.window.location.reload()',500)</script></td></tr>\n";
else if($data) {
if($data->activated == 0)
print " <tr><td class=\"mainTxt\">Je account is nog niet geactiveerd</td></tr>\n";
print " <tr><td class=\"mainTxt\"><center>Welkom $data->login,<br>Je wordt nu ingelogd.</center><br>
<center><script>
getal=0;
url='index-v1.php';
function load()
{
if(getal==100)
{
window.location=url;
}
else {
getal+=5;
tabel.width=getal;
text.innerHTML=getal+'%';
setTimeout('load()','100');
}
}
setTimeout('load()','100');
</script>
Loading...
<div id=text></div>
<table cellpadding=0 cellspacing=0 width=102 style='border:1 solid black'>
<tr><td align=left>
<table cellpadding=0 cellspacing=0 bgcolor=#996600 height=11 id=tabel>
<tr><td></tr></td></table></tr></td></table></center>
\n <script language=\"javascript\">setTimeout('parent.window.location.reload()',5500)</script>\n </td></tr>\n";
}
else {
if(isset($_POST['login'],$_POST['pass']))
print " <tr><td class=\"mainTxt\">Verkeerde login of wachtwoord</td></tr>\n";
print <<<ENDHTML
<tr><td class="mainTxt">
<form method="post"><table align="center">
<td><input type="text" name="login" maxlength=16 style="width: 150;"></td></tr>
<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="signup.php">Aanmelden</a></td></tr>
ENDHTML;
}
/* ------------------------- */ ?>
</table>
</body>
</html>
<?php /* ------------------------- */ include("_include-config.php"); if(isset($_POST['login'],$_POST['pass'])) { $dbres = mysql_query("SELECT `login`,`activated` FROM `[users]` WHERE `login`='{$_POST['login']}' AND `pass`=MD5('{$_POST['pass']}')"); 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']}'"); } } else if($_GET['x'] == "logout") { mysql_query("DELETE FROM `[online]` WHERE `login`='{$_COOKIE['login']}' AND `validate`='{$_COOKIE['validate']}' AND `IP`='{$_SERVER['REMOTE_ADDR']}'"); unset($_SESSION['login']); unset($_SESSION['data']); } /* ------------------------- */ ?> <html> <head> <title><--counter terrors--></title> <link rel="stylesheet" type="text/css" href=" <?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>"> </head> <body style="background: #996600; margin: 0px;"> <table align="center" width=100%> <?php /* ------------------------- */ if($_GET['x'] == "logout") print " <tr><td class=\"subTitle\"><b>Login</b></td></tr>\n <tr><td class=\"mainTxt\">Je bent nu uitgelogd\n <script language=\"javascript\">setTimeout('parent.window.location.reload()',500)</script></td></tr>\n"; else if($data) { if($data->activated == 0) print " <tr><td class=\"mainTxt\">Je account is nog niet geactiveerd</td></tr>\n"; print " <tr><td class=\"mainTxt\"><center>Welkom $data->login,<br>Je wordt nu ingelogd.</center><br> <center><script> getal=0; url='index-v1.php'; function load() { if(getal==100) { window.location=url; } else { getal+=5; tabel.width=getal; text.innerHTML=getal+'%'; setTimeout('load()','100'); } } setTimeout('load()','100'); </script> Loading... <div id=text></div> <table cellpadding=0 cellspacing=0 width=102 style='border:1 solid black'> <tr><td align=left> <table cellpadding=0 cellspacing=0 bgcolor=#996600 height=11 id=tabel> <tr><td></tr></td></table></tr></td></table></center> \n <script language=\"javascript\">setTimeout('parent.window.location.reload()',5500)</script>\n </td></tr>\n"; } else { if(isset($_POST['login'],$_POST['pass'])) print " <tr><td class=\"mainTxt\">Verkeerde login of wachtwoord</td></tr>\n"; <tr><td class="mainTxt"> <form method="post"><table align="center"> <td><input type="text" name="login" maxlength=16 style="width: 150;"></td></tr> <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="signup.php">Aanmelden</a></td></tr> ENDHTML; } /* ------------------------- */ ?> </table> </body> </html>
dit is mijn template
<html>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#333333" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (index.psd) -->
<table id="Tabel_01" width="600" height="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3">
<img src="images/index_01.gif" width="600" height="297" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/index_02.gif" width="233" height="103" alt=""></td>
<td>
<iframe src="login.php" width="355" height="70" frameborder="0" scrolling="auto"><img src="images/login.gif" width="355" height="70" alt=""></iframe></td>
<td rowspan="2">
<img src="images/index_04.gif" width="12" height="103" alt=""></td>
</tr>
<tr>
<td>
<img src="images/index_05.gif" width="355" height="33" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
<html> <head> <title>index</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#333333" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- ImageReady Slices (index.psd) --> <table id="Tabel_01" width="600" height="400" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"> <img src="images/index_01.gif" width="600" height="297" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="images/index_02.gif" width="233" height="103" alt=""></td> <td> <iframe src="login.php" width="355" height="70" frameborder="0" scrolling="auto"><img src="images/login.gif" width="355" height="70" alt=""></iframe></td> <td rowspan="2"> <img src="images/index_04.gif" width="12" height="103" alt=""></td> </tr> <tr> <td> <img src="images/index_05.gif" width="355" height="33" alt=""></td> </tr> </table> <!-- End ImageReady Slices --> </body> </html>
|