Dit heb ik nu allemaal:En bij het welkomsbericht staat:Wat is er fout?!
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]functions.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// Sessie is verlopen, cookie niet[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #FF8000]// Selecteer sessie op cookie [/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT uId,uName,uPass FROM member_accounts WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"SQL: "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sQuery[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Array:FORUMCODE0"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]// Als ip overeenkomt[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]SesIp[/COLOR][COLOR= #007700]])
{[/COLOR]
[COLOR= #FF8000]// Zetten we de sessie[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]SesId[/COLOR][COLOR= #007700]];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]// Als beide geset zijn[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #FF8000]// Als beide een waarde hebben [/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #FF8000]// Maar deze waardes niet overeenkomen[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]]) {[/COLOR]
[COLOR= #FF8000]// Verwijder dan de gegevens[/COLOR]
[COLOR= #007700]@[/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM member_sessions WHERE uHash = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"uHash"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]()-[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]24[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]7[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]700[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// En refresh[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<meta http-equiv="refresh" content="0;url=index.php">[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$sQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT SesIp, SesId FROM member_sessions WHERE SesHash = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sQuery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// Als ip of uId niet overeenkomt met de waades in de sessie[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]SesIp[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]]) || ([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]SesId[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #FF8000]// Deleten en refresh[/COLOR]
[COLOR= #007700]@[/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM member_sessions WHERE uHash = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uHash[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"uHash"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]()-[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]24[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]7[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]700[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<meta http-equiv="refresh" content="0;url=index.php">[/COLOR][COLOR= #007700];
}
}
}
}
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE member_accounts SET uLast = NOW() WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]);
}[/COLOR]
?>Spoiler tonen
<li><a href="#" class="user"><span class="bar">Welkom [COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/print_r"]print_r[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700]);[/COLOR]
?></span></a></li>
