Hyperlinking in Tekstboxes
Posted: Sat Mar 20, 2010 12:24 pm
Dear fellow members,
I'm currently working on a website for school and I'm having some problems with it. The project my group got assigned to is to make a website where one could order wine. Since we work in a group, we decided to split tasks up and I got the page where you can view the products. One of the requirements was that the site used a database. I've got that up and running now. Our page lay-out is basically 3 columns. I got the database to return the wine-names into one of the columns, and I've made hyperlinks of them. Now I want the following to happen, but I can't get it fixed: If you click the wine-name, the information on the wine opens up in the most right column.
Code:
My variables are in Dutch because Im from the Netherlands. If it makes the story unclear, please post so and I'll translate them.
I have included a picture
for when the story is too vague.
I would really appreciate it if someone could help me solve this problem.
I'm currently working on a website for school and I'm having some problems with it. The project my group got assigned to is to make a website where one could order wine. Since we work in a group, we decided to split tasks up and I got the page where you can view the products. One of the requirements was that the site used a database. I've got that up and running now. Our page lay-out is basically 3 columns. I got the database to return the wine-names into one of the columns, and I've made hyperlinks of them. Now I want the following to happen, but I can't get it fixed: If you click the wine-name, the information on the wine opens up in the most right column.
Code:
Code: Select all
<html>
<head>
<meta http-equiv="Generator" content="TigerII MiniPad (C)2001">
<title>Producten</title>
<style type="text/css">
Body {
background-image: url("achtergrond.jpg");
background-repeat: no repeat;
background-attachment: fixed;
}
.navbar {
padding-left: 1;
}
</style>
<?php
$server = "localhost" ;
$user = "root" ;
$wachtwoord = "" ;
$database = "rossano";
$resultaat = "";
if (!$db = mysql_connect($server, $user, $wachtwoord)){
$boodschap = "<h2>Verbinding met de databaseserver is mislukt!</h2>";
};
if (!mysql_select_db($database)) {
$boodschap .="de database \"$database\" kon niet gevonden worden!";
};
if (!isset($_GET["id"])){
$query = "SELECT naam , producent , prijs, jaar, soort, commentaar FROM wijn";
}
else{
$query = "SELECT * FROM wijn";
}
$resultaat= mysql_query($query, $db) or die ( "er is een probleem met query");
?>
</head>
<body>
<table border="3">
<tr>
<td COLSPAN="4"><a><img src="banner.jpg"></a></td>
</tr>
<tr>
<td><div class="navbar">
<a href="Homepage.htm"><img src="home.png" alt="Ga naar de homepagina" width="120" height="24" align="bottom" STYLE="border: solid 1px black;"></a><br>
<a href="BBBB.htm"><img src="contact.png" alt="Neem contact met ons op" width="120" height="24" align="bottom" STYLE="border: solid 1px black;"></a><br>
<a href="Producten.php"><img src="producten.png" alt="Bekijk onze producten" width="120" height="24" align="bottom" STYLE="border: solid 1px black;"></a><br>
<a href="DDDD.htm"><img src="bestellen.png" alt="Rond uw bestelling af" width="120" height="24" align="bottom" STYLE="border: solid 1px black;"></a>
</div></td>
<td> <?php
if (!isset ($GET["naam"])) {
echo "";
while(list($naam ,$soort ,$producent ,$prijs ,$jaar ,$commentaar ) = mysql_fetch_row($resultaat)){
echo "<li><a href=\"" . $_SERVER["PHP_SELF"] . "?naam=$naam\">". $naam . "</a>\n";
}
echo "</ol>";
}
else{
while(list($naam , $soort, $producent, $prijs, $jaar, $commentaar) =
mysql_fetch_row($resultaat)){
echo "<h2>Detail-gegevens voor:
naam: $naam </h2>
soort: <b>$soort </b><br>
producent: <b>$producent </b><br>
prijs: <b>$prijs </b><br>
jaar: <b>$jaar </b><br>
commentaar: <b> $commentaar </b><br>
<hr>
<a href=\"" . $_SERVER["PHP_SELF"] . "\">
Terug naar het overzicht</a>";
};
Mysql_error();
};
mysql_close($db);
?>
</td><td>/Results here/</td>
<?php echo $boodschap; ?>
</tr>
</table>
</body>
</html>
I have included a picture
for when the story is too vague. I would really appreciate it if someone could help me solve this problem.