I'm developing a new webpage and I want to be able to store all of the links in one file and simply include it. I want it to be dynamic too so that I only update things in the database.
So I have my index.php file that has some code on it and some html stuff.
I have an include file that i want to put the links in and using switch evaluate $_SERVER['QUERY_STRING'];
I want to go to that page.
so here's what i have for the links page....
<?php
// one file to store the links in and be included on each page.
require_once 'http://photography.ronhnelson.com/includes/conn.php.inc';
include 'includes/conn.php.inc';
//select all of the links from the database
$sql = "SELECT * FROM tblLink";
$result = mysql_query($sql) or die(mysql_error());
echo "<div class=\"content\">";
echo "<p class=\"links\">";
if(mysql_num_rows($result) > 0){
$i = 0;
while ($row = mysql_fetch_array($result)){
$linkpath = $row['path'];
$linkname = $row['LinkName'];
$linkID = $row['link_ID'];
echo "<a href=link.php?link_id=$linkID>";
echo $linkname;
echo "<a/><br />";
}
}else{
echo "No rows returned";
}
echo "</p>";
echo "</div>";
switch ($_SERVER['QUERY_STRING']){
case "?link_id=1":
echo "????????????";
break;
case "?link_id=2":
echo "??????";
break;
case "?link_id=3";
echo "?????????
?>
I hope it is clear of what I want to do. If not please feel free to ask questions.