Page 1 of 1

PHP Side bar

Posted: Thu Oct 09, 2003 12:37 pm
by NeoSsjin
It's like when you are the main site you see the main site gfx pic on the right. When you click a section on the top right Reviews for example you will be taken to the reviews section he ofcourse uses PHP Include but as the page goes there not only the content changes but the side bar too instead of showing their pic it shows another pic saying Reviews. I'm sure it's a more advanced PHP Include than the one I use. So please if you know how it works please reply here. And Here is a site that uses what I want to use: http://evo3.anime-cubed.net/

Thanks neoSS

Posted: Thu Oct 09, 2003 2:25 pm
by Gen-ik
Your web page..

Code: Select all

<html>
<body>
<?php
$theImage = "reviews.gif";
include("sidebar.php");
?>
</body>
</html>
Your include file..

Code: Select all

<?php
//include the image
echo ('<img src="images/'.$theImage.'">');
?>
------------------------------

The files you include() into your web pages can read any variables you've set in the main page.

Hope that helps.

Posted: Thu Oct 09, 2003 2:55 pm
by like_duh44
If I'm understanding you correctly, you want a sidebar. It doesnt necessarily have to be php. Note the html used:

Code: Select all

<html>
<body><body bgcolor="black">
<table width="245" border="1" align="right" cellpadding="0" cellspacing="0" bordercolor="#666666" bgcolor="#000000">
  <tr> 
    <td><img src="splash.jpg" width="245" height="539" border="0" usemap="#Map"></td>
  </tr>
</table>
<map name="Map">
  <area shape="rect" coords="14,275,237,293" href="index2.php">
</map>
</body>
</html>
As you can see, the table is aligned to the right. Thats where it gets the right part. Then you can just replace the picture with yours, and change the rectange select size to whatever. That should about do it for ya

Posted: Fri Oct 10, 2003 1:09 am
by McGruff
I would suspect that the script includes html in php rather than php in html.

Standard practice is to declare a bunch of $vars with php, then include an html template where they are echo'd out.

If the two pages you mentioned share the same html template, perhaps a php script sets an $image_name var - a different image in different pages. In the html template, you'd have something like

<img src="<?php echo $image_name; ?>" />

Who knows how they did it, but that's the way I'd recommend viewing the problem: define a bunch of vars, echo them in a template. Php scripts define the dynamic bits, static parts of the page are defined in the html.

Posted: Fri Oct 10, 2003 6:48 am
by NeoSsjin
Gen-ik is the most close I think the only thing left is what URL shall I type so the content and the bar on side will be changed. Something like this: http://evo3.anime-cubed.net/index2.php? ... dexnav.txt.