View previous topic :: View next topic |
Author |
Message |
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Sat Mar 26, 2005 6:40 pm Post subject: Navigation Script |
|
|
A message
Last edited by Arctic on Sat Apr 20, 2019 5:26 pm; edited 1 time in total |
|
Back to top |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun Mar 27, 2005 12:04 am Post subject: Re: Navigation Script |
|
|
glyde51,
Yes this possible. All you have to do is to create a script called index.php and put it is the root of your web site.
This script will be:
Code: |
<?php
include "C:\\somepath\\" . $_GET['p'];
?>
|
include doesn't handle binary files correctly. So we need to modify the script and use another instruction for Flash data. We must take care and set the MIME types correctly. Below is the second version with .swf files support:
Code: |
<?php
$filepath="C:\\somepath\\";
$filename = $_GET['p'];
/* Test if the file name ends with .swf */
if (eregi("\.swf$", $filename))
{
header("Content-type: application/x-shockwave-flash");
readfile($filepath . $filename);
}
else
include $filepath . $filename;
?>
|
_________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Sun Mar 27, 2005 4:00 am Post subject: |
|
|
A message
Last edited by Arctic on Sat Apr 20, 2019 5:26 pm; edited 1 time in total |
|
Back to top |
 |
 |
aprelium-beta -
Joined: 24 Jun 2004 Posts: 383
|
Posted: Sun Mar 27, 2005 5:09 pm Post subject: |
|
|
It's normal to have some trouble with SWF files because there should be no PHP output before the header and the readfile statements execution. The code should be changed to the following in order to work:
Code: |
<?php
$filepath="http://www.trielite.net/";
$filename = $_GET['p'];
/* Test if the file name ends with .swf */
if (eregi("\.swf$", $filename))
{
header("Content-type: application/x-shockwave-flash");
readfile($filepath . $filename);
}
else
{
?>
<HTML>
<HEAD>
<TITLE>The Trielite</TITLE>
<style type='text/css'>
a:link, a:visited, a:active { text-decoration: underline;color: #666666; }
a:hover { text-decoration: underline;color: #333333; }
html { overflow-x: auto; }
form { display: inline; }
BODY { font-family: Verdana, Tahoma, Arial, sans-serif;font-size: 10px;SCROLLBAR-FACE-COLOR: #444444;SCROLLBAR-HIGHLIGHT-COLOR: #444444;SCROLLBAR-SHADOW-COLOR: #333333;SCROLLBAR-3DLIGHT-COLOR: #555555;SCROLLBAR-ARROW-COLOR: #777777;SCROLLBAR-TRACK-COLOR: #333333;SCROLLBAR-DARKSHADOW-COLOR: #333333;color: #000000;background: #C5C5C5}
TABLE, TR, TD { font-family: Verdana, Tahoma, Arial, sans-serif;font-size: 10px;color: #000000; }
hr {background-color: #000000; color: #000000; height: 1px}
</style>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta name="robots" content="index,follow">
<meta name="description" content="This is the offical website of the Trielite forums and clan and gaming community. Join the forums and make this site great, because this community needs to get some wings and fly.">
<meta name="keywords" content="Renegade, Command, Conquer, Trielite, UPEO, Generals, Zero, Hour, Community, Clan, Unreal, Tournament, 2004, UT:2004, Gaming, Fun, Games, Game, Fun, Starting">
</HEAD>
<BODY>
<?php
include $filepath . $filename;
}
?>
</body>
</html> |
_________________ Beta Testing Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|