Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Programming & Software Development

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 26th January 2008, 6:23 PM   #1
Orions Thread Starter
Awaiting Email Confirmation
 
Join Date: Jun 2003
Location: Melbourne
Posts: 304
Default [updated] Please Help. PHP.

Code:
<?php
$config["path"] = "";
$config["ext"] = ".php";

if (!isset($_REQUEST["page"])){
    $page = "main";
} else {
    $page = $_REQUEST["page"];
    $page = urldecode($page);
    $page = trim($page);
    $page = strip_tags($page);
    if (substr_count($page,"..") > 0 || substr_count($page,"~") > 0){
        $page = "main";
    }
}
$full = $config["path"] . $page . $config["ext"];
if (!is_file($full) || is_dir($full) || !file_exists($full)){
    die ("Sorry, the page you are looking for is gone. Please email the webmaster with the URL currently in your address bar so that it can be corrected. Thanks!");
} else {
    require_once($full);
}
?>
Can somebody please help me rescript this code, to allow for & functions to a similar nature to this:
Quote:
<a href="index.php?page=home&file=article&sid=78">
This way it will allow for more flexibility when navigating my site, so that the links dont HAVE to reside on the index.php page, but can also be inside pages that are $_REQUEST'ed

Last edited by Orions; 28th January 2008 at 2:42 PM. Reason: code incorrect for my site
Orions is offline   Reply With Quote

Join OCAU to remove this ad!
Old 26th January 2008, 6:35 PM   #2
bugayev
Whammy!
 
bugayev's Avatar
 
Join Date: May 2003
Location: Melbourne
Posts: 3,945
Default

Its asking for main.php, not home.php if you don't pass any arguments.
__________________
Administrator: Apple Desktop Hardware/Software, Graphics and Programming, Digital Art, iOS Devices, For Sale (PC and Non-PC), Price Check and What/Where Should I Buy?
mercury: 11" Macbook Air, i5, 4Gb RAM, 128Gb SSD
lunchbox: Mac mini, i5 Dual Core, 4Gb RAM, 500Gb HDD
bugayev is offline   Reply With Quote
Old 26th January 2008, 6:40 PM   #3
Orions Thread Starter
Awaiting Email Confirmation
 
Join Date: Jun 2003
Location: Melbourne
Posts: 304
Default

Updated thread.

Last edited by Orions; 28th January 2008 at 2:42 PM. Reason: Updated thread
Orions is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 9:52 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!