Ik heb op mijn login pagina een login button maar deze zou als je erop klikt en er zijn geen problemen ( password, username bestaan niet ofzo)
Zou deze moeten linken naar start.php
Hoe doe ik dit?
login.php
PHP
<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("Fout.");
if ($row->ban != 0) {
fout("Je bent gebanned. Neem contact op via [email protected] voor meer infomatie.");
}
}
}
?>
Toon Meer