Ik ben hier nu al tijdje mee bezig en wat ik ook doe het komt maar niet goed...
namelijk bij inloggen als je dus een foute username, of password hebt zou de pagina alleen de foutmelding moeten laten zien en niet de goedmelding:
PHP
<?
include "config.php";
if(isset($_POST['login1']))
{
echo "<div class='green'> U bent succelvol ingelogd! <u>u wordt zo dadelijk door gelinkt</u></div><br />";
?>
<center><b>U wordt zo dadelijk ingelogd</b><br /><img src="img/content/loading11.gif" alt="" /></center>
<meta http-equiv="REFRESH" content="2;url=http://www.166.snel-it.nl/T2K/index.php?p=home">
<?
}
?>
<script language="javascript">
<!--
var state = 'none';
function showhide(layer_ref) {
if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) {
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) {
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
//-->
</script>
<center>
<form method="post">
<table cellspacing="1" cellpadding="1" class="lijst">
<tr>
<h2>Login </h2><br />
<div style="width:230px"> <!-- LINE WRAPPER! -->
<div class="horizontal_line"></div>
</div>
</td>
</tr>
<tr>
<td width="120" style="padding:5px;" align="right">Login</td>
<td width="120" style="padding:5px;" align="left"><input type="text" name="login" value="" onclick="login.value=''" size="20" class="inline_text_inp" /></td>
</tr>
<tr>
<td width="120" style="padding:5px;" align="right">Wachtwoord</td>
<td width="120" style="padding:5px;" align="left"><input type="password" name="wachtwoord" value="" onclick="wachtwoord.value=''" size="20" class="inline_text_inp" /></td>
</tr>
</table>
<tr>
<input type='submit' name='login1' value='Login!' class="RedButton" width="80px"> <div class="RedButton" style="width:100px"> <div> <a href="?p=aanmelden">Aanmelden</a> </div> </div>
</tr>
</form>
</center>
<?
if( isset($_POST["login1"]))
{
$query = mysql_query("select * from `crimz_leden` where `login`='".$_POST["login"]."'");
$row = mysql_fetch_object($query);
$wachtwoord1 = md5($_POST["wachtwoord"]);
if($wachtwoord1 == $row->wachtwoord && $row->ban == 0)
{
session_start();
$_SESSION['login']= $_POST["login"];
mysql_query("UPDATE `crimz_leden` SET `status`=1 WHERE `login` = '".$_POST["login"]."'");
?>
<script type="text/javascript">
submit_msg();
/* Request for Writing the Message */
function ajax_write(url){
if(window.XMLHttpRequest){
xmlhttp2=new XMLHttpRequest();
if(xmlhttp2.overrideMimeType){
xmlhttp2.overrideMimeType('text/xml');
}
} else if(window.ActiveXObject){
try{
xmlhttp2=new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try{
xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
} catch(e){
}
}
}
if(!xmlhttp2) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
xmlhttp2.open('GET',url,true);
xmlhttp2.send(null);
}
/* Submit the Message */
/*
function submit_msg(){
ajax_write("w.php?n=logingedaan&p=<? echo $_POST["login"]; ?>&m=clean");
}
*/
</script>
<?
}
else
{
fout("Uw gebruikersnaam of password is onjuist!");
if ($row->ban != 0) {
fout("Je bent gebanned. Neem contact op via [email protected] voor meer infomatie.");
}
}
}
?>
Toon Meer