Navigation Script

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Sat Mar 26, 2005 6:40 pm    Post subject: Navigation Script Reply with quote

A message

Last edited by Arctic on Sat Apr 20, 2019 5:26 pm; edited 1 time in total
Back to top View user's profile Send private message ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Mar 27, 2005 12:04 am    Post subject: Re: Navigation Script Reply with quote

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 View user's profile Send private message Send e-mail
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Sun Mar 27, 2005 4:00 am    Post subject: Reply with quote

A message

Last edited by Arctic on Sat Apr 20, 2019 5:26 pm; edited 1 time in total
Back to top View user's profile Send private message ICQ Number
aprelium-beta
-


Joined: 24 Jun 2004
Posts: 383

PostPosted: Sun Mar 27, 2005 5:09 pm    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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


Powered by phpBB phpBB Group