PHP & links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wat
Forum Newbie
Posts: 6
Joined: Mon Dec 08, 2003 10:26 am

PHP & links

Post by wat »

I constructed a webpage using the following code:

<body>
<?php
// find the name of the include file for the main section
$main = (isset($_GET['main']))? $_GET['main'] : "main";
$nav = (isset($_GET['nav'])) ? $_GET['nav'] : "nav";
$top = (isset($_GET['top'])) ? $_GET['top'] : "top";


$mainContent = "$main.php";
$navContent = "$nav.php";
$topContent = "$top.php";
?>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr height=131>
<td colspan=2 class='top' valign='bottom'>
<?php include($topContent) ?>
</td>
</tr>
<tr height=131>
<td colspan=2 class='???' valign='bottom'>
</td>
</tr>
<tr>
<td class='nav' width=125 valign='top'>
<?php include($navContent) ?>
</td>
<td class='right' valign='top'>
<?php include($mainContent) ?>
</td>
</tr>
</table>
</body>


everything is working fine till I want to change the content of "main" with an image link which is in the "nav" cell and which I wrote like this:

<a href='index.php?main=home.php'>

<img src=home.gif">

</a>

Well, regrettably nothing is showing up just a blank white table cell ???

Any help would be much appreciated
User avatar
aquila125
Forum Commoner
Posts: 96
Joined: Tue Dec 09, 2003 10:39 am
Location: Belgium

Post by aquila125 »

Your quotes are placed incorrectly.. (should be src='image.gif')

also.. change the way of including the pages to something like this:

switch ($_GET['main']){
case "possibility1":
$main="possibility1.php";
break;
case ...


else ppl can add anything they want by placing something like this in their url:

somepage.php?main=VERYSECUREPAGE

and that's not what you want :)
Post Reply