Nieuw lid |
|
Login.php:
<?
ob_start();
include("connect.php");
?>
<link rel="stylesheet" href="http://gangstaworld.themastermp3.nl/style/gangstastyle.css">
<?
if(!isset($attempt)){
$attempt = 0;
}
?>
<center>
<form action=<?=$_SERVER['PHP_SELF']; ?> method=POST>
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=400>
<th class=title colspan=2>Login</th>
<?
if(isset($_POST['submit'])){
$attempt = $_POST['attempt'];
if($attempt >= 3){
setcookie("attempt", time()+(5*60), time()+(5*60));
$attempt = 0;
echo "<tr><td colspan=2 class=subTitle align=center><b><font color=red>You only have 3 attempts, you will need to wait 5 minutes</font></b></td></tr>";
}
elseif($_COOKIE['attempt'] > time()){
$rest = $_COOKIE['attempt'] - time();
$mins = floor($rest/60);
$secs = $rest%60;
echo "<tr><td colspan=2 class=subTitle align=center><b><font color=red>You need to wait another ".$mins." minutes and ".$secs." seconds.</td></tr>";
}
elseif(!mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `username` = '".$_POST['username']."' AND `password` = '".md5($_POST['password'])."'"))){
$attempt++;
echo "<tr><td colspan=2 class=subTitle align=center><b><font color=red>This combination is invalid.</font></b><br>Attempt ".$attempt."/3</td></tr>";
}
else{
$username = $_POST['username'];
setcookie("username", $username, time()+7200);
echo "<tr><td class=subTitle colspan=2 align=center><meta http-equiv=Refresh content=0;url=http://gangstaworld.themastermp3.nl/money/test.php>Welcome back ".$_COOKIE['username']."</td></tr>";
}
}
?>
<tr><td><table border=0 cellspacing=1 cellpadding=2 width=100%>
<input type=hidden name=attempt value=<?=$attempt; ?>>
<tr><td>Username:</td><td><input type=text name=username size=30 maxlength=20 onfocus="if(this.value == 'Username'){ this.value = ''; }" onblur="if(this.value == ''){ this.value = 'Username'; }"></td></tr>
<tr><td>Password:</td><td><input type=password name=password size=30 maxlength=30 onfocus="if(this.value == 'Password'){ this.value = '';}" onblur="if(this.value == ''){ this.value = 'Password'; }"></td></tr>
<tr><td colspan=2 align=center><input type=submit value=Login name=submit></td></tr>
</table></td></tr>
</table>
</form>
<br><br>
<a href=register.php>Register</a> | <a href=lostpw.php>Lost password</a> | <a href=mailto:gangstaworld@themastermp3.nl>Contact</a>
<? include("connect.php"); ?> <link rel="stylesheet" href="http://gangstaworld.themastermp3.nl/style/gangstastyle.css"> <? $attempt = 0; } ?> <center> <form action=<?=$_SERVER['PHP_SELF']; ?> method=POST> <table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=400> <th class=title colspan=2>Login</th> <? if(isset($_POST['submit'])){ $attempt = $_POST['attempt']; if($attempt >= 3){ $attempt = 0; echo "<tr><td colspan=2 class=subTitle align=center><b><font color=red>You only have 3 attempts, you will need to wait 5 minutes</font></b></td></tr>"; } elseif($_COOKIE['attempt'] > time()){ $rest = $_COOKIE['attempt'] - time(); $secs = $rest%60; echo "<tr><td colspan=2 class=subTitle align=center><b><font color=red>You need to wait another ".$mins." minutes and ".$secs." seconds.</td></tr>"; } elseif(!mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `username` = '".$_POST['username']."' AND `password` = '".md5($_POST['password'])."'"))){ $attempt++; echo "<tr><td colspan=2 class=subTitle align=center><b><font color=red>This combination is invalid.</font></b><br>Attempt ".$attempt."/3</td></tr>"; } else{ $username = $_POST['username']; echo "<tr><td class=subTitle colspan=2 align=center><meta http-equiv=Refresh content=0;url=http://gangstaworld.themastermp3.nl/money/test.php>Welcome back ".$_COOKIE['username']."</td></tr>"; } } ?> <tr><td><table border=0 cellspacing=1 cellpadding=2 width=100%> <input type=hidden name=attempt value=<?=$attempt; ?>> <tr><td>Username:</td><td><input type=text name=username size=30 maxlength=20 onfocus="if(this.value == 'Username'){ this.value = ''; }" onblur="if(this.value == ''){ this.value = 'Username'; }"></td></tr> <tr><td>Password:</td><td><input type=password name=password size=30 maxlength=30 onfocus="if(this.value == 'Password'){ this.value = '';}" onblur="if(this.value == ''){ this.value = 'Password'; }"></td></tr> <tr><td colspan=2 align=center><input type=submit value=Login name=submit></td></tr> </table></td></tr> </table> </form> <br><br> <a href=register.php>Register</a> | <a href=lostpw.php>Lost password</a> | <a href=mailto:gangstaworld@themastermp3.nl>Contact</a>
en dan de pagina:
<?php
ob_start();
$username = $_COOKIE['username'];
include("connect.php");
if(!isset($_COOKIE['username'])){
die("Not logged in");
}
?>
<link rel=stylesheet href=http://gangstaworld.themastermp3.nl/style/gangstastyle.css>
<?
$sql = mysql_query("SELECT * FROM `users` WHERE `username` = '".$username."'");
$user = mysql_fetch_object($sql);
$language = $user->language;
$money = $user->money;
$attempts = $user->crime_attempts;
$succes = $user->crime_succes;
$earned = $user->crime_earnings;
$lastcrime = $user->lastcrime;
$succes = explode("-", $user->crimes);
$timenow = time();
if($language == 'nl'){
if($lastcrime > $timenow){
die("* You are only allowed to do one crime every 2 minutes.");
}
?>
<center>
<form action=<?=$_SERVER['PHP_SELF']; ?> method=POST>
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=50% rules=none>
<th class=title colspan=3>Misdaden</th>
<tr><td align=center colspan=3><img src=http://gangstaworld.themastermp3.nl/style/crimes.jpg></td></tr>
<?
}
?>
<?php $username = $_COOKIE['username']; include("connect.php"); if(!isset($_COOKIE['username'])){ } ?> <link rel=stylesheet href=http://gangstaworld.themastermp3.nl/style/gangstastyle.css> <? $sql = mysql_query("SELECT * FROM `users` WHERE `username` = '".$username."'"); $language = $user->language; $money = $user->money; $attempts = $user->crime_attempts; $succes = $user->crime_succes; $earned = $user->crime_earnings; $lastcrime = $user->lastcrime; $succes = explode("-", $user->crimes); if($language == 'nl'){ if($lastcrime > $timenow){ die("* You are only allowed to do one crime every 2 minutes."); } ?> <center> <form action=<?=$_SERVER['PHP_SELF']; ?> method=POST> <table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=50% rules=none> <th class=title colspan=3>Misdaden</th> <tr><td align=center colspan=3><img src=http://gangstaworld.themastermp3.nl/style/crimes.jpg></td></tr> <? } ?>
|