<div style="width=464;height=11;top=95;left=240;positio n:absolute;">
<?php
//We include the page file which is located in the Site directory
$fn = "" . $_GET['id'] . ".htm"; if (file_exists($fn)) {include($fn);} else {include("404.htm");}
?>
</div>
</body>
<html>
I have 2 problems when I call the script with a link <a href="index.php?id=newz">newz</a> which means load the file newz.htm in the place where div specifies it loads newz.htm befind the current content of the webpage and I need it to be on top of it or that the old content would not show up and the 404.htm page allways shows up and I need it to show up only whe "id" cannot find the file.
here is my webpage http://www.pb.exocrew.com/digitalf/web/index.php
and try to use it with an id and see what happends http://www.pb.exocrew.com/digitalf/w...x.php?id=index http://www.pb.exocrew.com/digitalf/w...p?id=downloads
This is on IE, it doesn't render correctly in Mozilla
the one that ends with ?id=downloads is loading behind the content, the one that you should look at is http://www.pb.exocrew.com/digitalf/web/index.php and compare it with http://www.pb.exocrew.com/digitalf/w...x.php?id=index you should see the difference, the new layer should be on top but it is on the bottom, I need to make the new layer to show up on top of the old layer and not show up the layer below it.
<html>
<head>
</head>
<body>
<a href="index.php?id=newz">newz</a>
<div style="width=464;height=11;top=95;left=240;position:absol ute;">
<?php
//We include the page file which is located in the Site directory
$id = "" . $_GET['id'] . ".htm"; if (file_exists($id)) {include($id);} else {include("404.htm");}
?>
</div>
</body>
<html>
Try that, and linking the same way.
$_GET['id'] wasn't working, because the variable you set was $fn, not $id, so therefore it returns false.
<html>
<head>
</head>
<body>
<a href="index.php?id=newz">newz</a>
<div style="width=464;height=11;top=95;left=240;position:absol ute;">
<?php
//We include the page file which is located in the Site directory
$id = "" . $_GET['id'] . ".htm"; if (file_exists($id)) {include($id);} else {include("404.htm");}
?>
</div>
</body>
<html>
Try that, and linking the same way.
$_GET['id'] wasn't working, because the variable you set was $fn, not $id, so therefore it returns false.
Still aint working the new layer is still being loaded behind an old layer, here is an example http://www.pb.exocrew.com/digitalf/w...x.php?id=index , what this does it is just loading the same page into it self.
If that's what you're trying to do, keep reading, if not stop here...
Source for index.php:
PHP Code:
<html>
<head>
<meta name="description" content="Calgary and Montreal Hangout For Gamers!" />
<meta name="keywords" content="DigitalFiles,DigitalFiles.tk,DigitalFiles.da.ru" />
<meta name="copyright" content="Copyright 2004 DigitalFiles ALL RIGHTS RESERVED" />
<title>Welcome to DigitalFiles.Da.Ru</title>
<style type="text/css">
<!--
<!-- Server Status example <img src="http://digitalf.togetherhost.com/status/status.php?link=www.digitalf.togetherhost.com" border="3" />-->
<!-- Body Info -->
<div style="width=464;height=11;top=95;left=240;position:absolute;" class="body-text">
<?php
//We include the page file which is located in the Site directory
$fn = "" . $_GET['id'] . ".htm";
if (file_exists($fn))
{
include($fn);
}
else
{
include("404.htm");
}
?>
</div></body></html>
As for index.htm, download.htm, 404.htm, you just need to create pages which will be included in your index.php file. Since your index.php already has a navigation bar, you do not need to have a navigation bar in these pages.
Example of index.htm:
Code:
<img src="images/hr.gif" alt="" />
<br />
<h4>Welcome to DigitalFiles.Da.Ru</h4>
May 23,2004 <a href="mailto:grunt_g_@hotmail.com?subject=DigitalFiles">Dark Sniper </a><br />
<div style="left=5;position:relative;">
Updated the forum.
</div><br />
May 20,2004 <a href="mailto:grunt_g_@hotmail.com?subject=DigitalFiles">Dark Sniper </a><br />
<div style="left=5;position:relative;">
Second part of news!<br />Finally found out a way to validate as XHTML and keep my JavaScript code. Orgenized the code a bit, so it would
easier to modify or add more code.
</div><br />
May 20,2004 <a href="mailto:grunt_g_@hotmail.com?subject=DigitalFiles">Dark Sniper </a><br />
<div style="left=5;position:relative;">
Changed the random script file to use objects instead of using embed, validated both
CSS and the webpage as XHTML 1.0. Still have one object javascript error which is
not compatible with XHTML 1.0 but I have no idea how to fix it, since
<a href="http://validator.w3.org" target="_blank">http://validator.w3.org</a> doesnt like neither embed and neither object in javascript.
<a href="mailto:Dark_energy_@hotmail.com?subject=DigitalFiles">Dark Energy </a> is working on the logo for the webiste.
</div><br />
May 19,2004 <a href="mailto:grunt_g_@hotmail.com?subject=DigitalFiles">Dark Sniper </a><br />
<div style="left=5;position:relative;">
Fixed few bugs that we have on the webpage, improoved page loading, added
random music script, fixed few links, added and <a href="./dl/index.php?nu.mp3">testing</a> out new php scripts.
</div><br />
May 13,2004 <a href="mailto:grunt_g_@hotmail.com?subject=DigitalFiles">Dark Sniper </a><br />
<div style="left=5;position:relative;">
We have moved onto a different server.
</div><br />
<img src="images/hr.gif" alt="" />
The source for the sample download page was simply: