<?php session_start();

$login_time = $_SESSION[timeonlog];
$logout_time = time();

$sec = floor($logout_time - $login_time);
echo 'Du har v&aelig;ret online i ' . $sec . ' sekunder<br />';
$min = floor($sec / 60);
echo 'Du har v&aelig;ret online i ' . $min . ' minutter<br />';
$hour = floor($min / 60);
echo 'Du har v&aelig;ret online i ' . $hour . ' timer<br />';
//$coins = floor($sec / 360);
$coins = $hour*10;
echo 'Det giver dig ' . $coins . ' pycoins<br /><br /><br />';

$bnefore = mysql_query("SELECT * FROM `pytox_community` WHERE `bruger` LIKE '{$_COOKIE[user]}' LIMIT 1") or die(mysql_error());

	while ($before = mysql_fetch_array($bnefore)) {
$pycoins = $coins+$before[coins];

echo 'Førhenværende pycoins: '.$before[coins].'!<br />';

echo 'Opdaterede pycoins: '.$pycoins.'!<br />';

echo 'Førhenværende timer: '.$before[timer].'!<br />';

$optimer = floor($hour+$before[timer]);

$totime = floor($hour);

echo 'Timer der lægges til er '.$totime.'!<br />';

echo 'Opdaterede timer: '.$optimer.'!<br />';
	}
?>
<br />
<br />
$_SERVER['PHP_SELF'] = <?=$_SERVER['PHP_SELF']?>
<br />
<br />
opendir():
<br />
<?php
//Open images directory
$dir = @ opendir("gfx");

//List files in images directory
while (($file = readdir($dir)) !== false) {
  echo "Filename: ".$file."<br />";
  }
  closedir($dir);
?>
<br />
<hr />
<br />