:D som du vil hehe .. Hehe .. kender det sku godt ;)
Her er koden så.
på admin.php
<?php
/*ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);*/
session_start();
if(!session_is_registered("myusername")){
header("location:index.php");
exit();
}
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Golfen - Brugerside</title>
<link href="../layout/golfen.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>
<body>
<div class="wrapper">
<div id="container">
<div id="top">
</div>
<?php
/*
function Admin(){
global $session;
return ($this->status == 2)? TRUE : FALSE;
}
if(!$session->Admin()){
header("Location: brugerside.php");
exit();
}*/
$conn = mysqli_connect() or die (mysqli_error($conn));
?>
<div id="indhold">
<?php
//logout
echo '<form method="post" action="logout.php">';
echo '<input type="submit" value="Logout" /><br /><br /><br />';
//Forbindelse til databasen
$conn = mysqli_connect() or die (mysqli_error($conn));
?>
<table width="100%" border="0" cellpadding="3">
<tr>
<td>
</td>
<td>
<?php
echo "Adminstrator";
//logout
echo '<form method="post" action="logout.php">';
echo '<input type="submit" value="logout" /><br /><br /><br />';
echo "<h3>Siderne (Forside + Baner)</h3>";
//Database informationer til forsiden.
$conn = mysqli_connect() or die (mysqli_error($conn));
$query = mysqli_query($conn,"SELECT * FROM golf") or die (mysqli_error($conn));
$result = mysqli_fetch_array($query) or die (mysqli_error($conn)); {
echo "<strong>Forsiden:</strong><br />";
echo $result['indhold'];
echo "<br /><br />";
echo "<strong>Baner:</strong><br />";
echo $result['baner'];
echo "<br /><br />";
echo "<a href=\"edit1.php?id=".$result['id']."&type=golf\">Ret Siderne</a><br>";
}
mysqli_close($conn);
?>
<br />
<br />
<br />
<br />
<h3>Udstyr siden:</h3>
<?php
//Forbindelsen til databasen.
$conn = mysqli_connect() or die (mysqli_error($conn));
//henter fra databasen.
$minQuery="SELECT * FROM udstyr";
$resultat=mysqli_query($conn, $minQuery);
while ($row = mysqli_fetch_array($resultat)){ //behander resultatet.
echo "<br /><strong>Navn på varen:</strong><br />";
echo $row['navn'];
echo "<br /><br />";
echo "<strong>Beskrivelsen:</strong><br />";
echo $row['beskrivelse'];
echo "<br /><br />";
echo "<strong>Pris:</strong><br />";
echo $row['pris'];
echo "<br /><br />";
echo "<a href=\"edit2.php?id=".$row['id']."&type=golf\">Ret varen</a><br>";
echo "<a href=\"edit/delete.php?id=".$row['id']."&type=golf\">Slet varen</a><br>";
echo "<br /><br />";
}
include('upload.php');
?>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
</div>
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
body>
</html>