PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Maffiasolution</title>
<link rel="stylesheet" type="text/css" href="style1.css" />
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<meta name="author" content="MafiaForce" />
<meta name="robots" content="follow,index" />
<meta name="keywords" content="MafiaForce" />
<meta name="revisit-after" content="7 Days" />
<style type="text/css">
#purr-container {
position: fixed;
bottom: 0;
right: 0;
}
.notice {
position: relative;
width: 324px;
}
.notice .close {position: absolute; top: 12px; right: 12px; display: block; width: 18px; height: 17px; text-indent: -9999px; background: url(purr-example/purrClose.png) no-repeat 0 10px;}
.notice-body {
min-height: 50px;
padding: 22px 22px 0 22px;
background: url(purr-example/purrTop.png) no-repeat left top;
color: #f9f9f9;
}
.notice-img {margin: 0 5px 0 0; float: left;}
.notice-body h4 {margin: 0; font-size: 1.1em;}
.notice-body p {margin: 5px 0 0 35px; font-size: 0.8em; line-height: 1.4em; }
.notice-bottom {
height: 22px;
background: url(purr-example/purrBottom.png) no-repeat left top;
}
</style>
<script type="text/javascript">
function membersOn(level) {
var ajaxRequest;
try {
ajaxRequest = new XMLHttpRequest();
} catch (e) {
try {
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
}
}
}
ajaxRequest.onreadystatechange = function() {
if (ajaxRequest.readyState == 4) {
if (ajaxRequest.status != 200) {
}
else {
var info = ajaxRequest.responseText.split("|");
document.getElementById('info_1').innerHTML = "Online: " + info[0];
document.getElementById('info_2').innerHTML = "Vandaag: " + info[1];
document.getElementById('info_3').innerHTML = "Leden: " + info[2];
setTimeout('membersOn()',1000);
}
}
else {
}
}
ajaxRequest.open("GET", "ajax_on_outgame.php" + "?sid=" + (Math.random() * 1000000000), true);
ajaxRequest.send(null);
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
ajaxRequest.setRequestHeader("Connection", "close");
}
</script>
</head>
<body>
<div id="container">
<div id="content">
<div id="content_left">
<div class="header_algemeen"><h2>Algemeen</h2></div>
<div class="menu">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="#">Het verhaal</a></li>
<li><a href="aanmelden.php">Aanmelden</a></li>
<li><a href="#">Inloggen</a></li>
<li><a href="#">Wachtwoord vergeten?</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Statistieken</a></li>
</ul>
</div>
</div>
<div id="content_center">
<div class="nieuws-icon"></div>
<div class="content_header"><h2>Nieuws 20-02-2011</h2></div>
<div class="content">
<?php
session_start(); // Hier gaat het om <<<<<<<
require("connect.php");
if(isset($_POST['login'])) {
if(trim($_POST['naam']) <> "" && trim($_POST['wacht']) <> "") {
$naam = $_POST['naam'];
$wacht = md5($_POST['wacht']);
$res = mysql_query("SELECT id, pass, level FROM users where name='".$naam."'") or die(mysql_error());
if(mysql_num_rows($res) > 0) {
$row = mysql_fetch_assoc($res);
if(!strcmp($wacht, $row['pass'])) {
if(isset($_POST['memory'])) {
setcookie("login_cookie", $row['id'].";".$row['pass'], time()+3600*24*31*2, "/");
$ip = $_SERVER['REMOTE_ADDR'];
mysql_query("UPDATE users SET last_ip='".$ip."' WHERE id=".$row['id']) or die(mysql_error());
}
$_SESSION['suser'] = $naam; // gebruikersnaam van ingelogd persoon
$_SESSION['slevel'] = $row['level']; // bijbehorende gebruikersniveau
$_SESSION['stime'] = time(); // de huidige tijd
$_SESSION['smaxidle'] = 60 * 60; // het aantal seconden inactiviteit
} else {
$_SESSION = array();
session_destroy();
}
unset($row);
mysql_free_result($res);
}
header("Location: /ingame/play.php");
}
}
?>
<?php
if(!isset($_SESSION['suser'])) {
?>
<form action="login.php" method="post">
naam <input type="text" name="naam" size="15">
wachtwoord <input type="password" name="wacht" size="15">
<input type="checkbox" name="memory" value="1"> onthoud mijn login (gebruikt cookie)
<input type="submit" name="login" value="log in">
</form>
<?php
} else {
?>
Hi <b><?= $_SESSION['suser'] ?></b>,
<a href="voorbeeld.php">voorbeeld pagina</a>
<a href="logout.php">uitloggen</a>
<?php
}
?>
</div>
<div class="content-footer"></div>
<div class="nieuws-icon"></div>
<div class="content_header">
<h2>Update''</h2></div>
<div class="content"> <li> op dit moment zijn er nog geen update's!!!</div>
<div class="content-footer"></div>
</div>
</div>
<div id="content_right"><img src="img/screenshots-heading.png" width="227" height="45" />
<div class="menu">
<ul>
<li><a href="#">Screenshot</a></li>
<li><a href="#">Screenshot</a></li>
<li><a href="#">Screenshot</a></li>
<li><a href="#">Screenshot</a></li>
<li><a href="#">Screenshot</a></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
Toon Meer
Nieuwe reactie samengevoegd met originele reactie op 01.03.11 21:56:39:
Sorry voor al die moeite maar helaas kan het topic gesloten worden wegens een beter script gescript. :cheer: bedankt. :slotje: