Jeg er kommet lidt på afveje..
http://www.teamsf.frac.dk/testhp når man går ind på linket crew og derefter vælger info så hopper den tilbage.. Her er koden der hænger sammen...
testhp/index.php
<?php
if ($_GET['page'] == "default") {
$titel = "Forside";
}
?>
<html>
<head>
<title>|Star-Fighters| - <?php print $titel; ?></title>
</head>
<body>
<br>
<!-- Tabellen Starter her -->
<table align="center" cellpadding="0" cellspacing="0" width="600">
<!-- Banner Starter -->
<tr>
<td colspan="2"><img border="0" src="grafik/index/Banner.gif"></td>
</tr>
<!-- Banner Slutter -->
<!-- Hovedmenu begynder -->
<tr>
<td background="grafik/index/menu.gif" valign="top" width="120">
<br>
<br>
<a href="index.php?page=default">Forside</a><br>
<a href="index.php?page=crew">Crew</a><br>
</td>
<!-- Hovedmenu slutter -->
<!-- Mainframe begynder -->
<td background="grafik/index/webdesign.gif" width="480">
<?php
include("includes.php");
?>
</td>
</tr>
<!-- Mainframe slutter -->
</table>
<!-- Tabellen Slutter -->
</body>
</html>
testhp/includes.php
<?php
// Script til Forside
if ($_GET['page'] == "default") {
include("pages/main.php");
}
// Script til Crew
else if ($_GET['page'] == "crew") {
if ($_GET['mode'] == "show") {
include("pages/crew/index.php");
}
else if ($_GET['mode'] = "$id") {
include("/hp/pages/crew/show_members.php?crew_id=$id");
}
else {
print "<script>location.href='index.php?page=crew&mode=show'</script>";
}
}
// Gå til forside
else {
print "<script>location.href='index.php?page=default'</script>";
}
testhp/pages/crew/index.php
<?php
$conn = mysql_connect("localhost","???","???");
mysql_select_db("teamsf",$conn);
$get_members = "select id, nick, status from crew order by id asc";
$get_members_res = mysql_query($get_members,$conn);
if (mysql_num_rows($get_members_res) < 1) {
$display_block = "<p>Ingen medlemmer!</p>";
} else {
$display_block = "
<table cellpadding=3 cellspacing=1 border=0 align=center width=320>
<tr><th colspan=3><font size=3>Crew'et fra Danmark</font></th></tr>";
while ($members_info = mysql_fetch_array($get_members_res)) {
$id = $members_info['id'];
$nick = $members_info['nick'];
$status = $members_info['status'];
$display_block .= "
<tr><td width=120><font size=3>$nick</font></td><td width=200><font size=3>$status</font></td><td width=40><font size=3><a href=\\"index.php?page=crew&mode=$id\\">Info</a></font></td></tr>";
}
$display_block .= "</table>";
}
?>
<html>
<head>
<title>Members</title>
</head>
<body bgcolor=""><br>
<?php print $display_block; ?>
</body>
</html>
testhp/pages/crew/show_members.php
<?php
$conn = mysql_connect("localhost","???","???");
mysql_select_db("teamsf",$conn);
$verify_member = "select nick from crew where id = $_GET[crew_id]";
$verify_member_res = mysql_query($verify_member,$conn);
if (mysql_num_rows($verify_member_res) < 1) {
$display_block = "<p>Medlemmet findes ikke!</p>";
} else {
$member_nick = mysql_result($verify_member_res,0,'nick');
$get_member = "SELECT id, nick, navn, alder, city, mail, status, favo_map, favo_weapon, events, hardware from crew where id = $_GET[crew_id] order by id asc";
$get_member_res = mysql_query($get_member,$conn);
$display_block = "
<table align=center width=300 cellpadding=3 cellspacing=1 border=0>
<tr><th colspan=2><font size=3>$member_nick</font></th></tr>";
while ($member_info = mysql_fetch_array($get_member_res)) {
$id = $member_info['id'];
$nick = stripslashes($member_info['nick']);
$navn = $member_info['navn'];
$alder = stripslashes($member_info['alder']);
$city = $member_info['city'];
$mail = stripslashes($member_info['mail']);
$status = $member_info['status'];
$favo_map = stripslashes($member_info['favo_map']);
$favo_weapon = $member_info['favo_weapon'];
$events = stripslashes($member_info['events']);
$hardware = $member_info['hardware'];
$display_block .= "
<tr><td width=240><font size=3>
Navn: $navn<br>
Alder: $alder<br>
By: $city<br>
E-mail: $mail<br>
Status: $status</font></td></tr>
<tr><td width=300 colspan=2><font size=3>
Favorit Map: $favo_map<br>
Favorit Våben $favo_weapon<br>
Events:<br>
$events<br><br>
Hardware:<br>
$hardware
</font></td></tr>";
}
$display_block .= "
</table>
<br>
<center><font size=3><a href=\\"index.php\\">Tilbage</a></font></center>";
}
?>
<html>
<head>
<title>Crew - <? print $nick; ?></title>
<link rel="stylesheet" href="../../styles/universal.css" type="text/css">
</head>
<body><br>
<?php print $display_block; ?>
</body>