You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 48 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Including modules.php rather than calling it? [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
timnicholson
Nuke Cadet
Nuke Cadet


Joined: Jul 26, 2004
Posts: 7


PostPosted: Sat Jun 24, 2006 5:04 am Reply with quoteBack to top

I have seen googletap, but wanted something similar but without using modrewrite's, so I developed my own system to call each individual module with its own direct .php file in the root directory. ie. news.php, content.php, forums.php, etc.

My system still uses variables, of course, but the URL's are MUCH simpler. eg. content.php?pid=3 will display content page 3 instead of having to use modules.php?name=Content&op=showpage&pid=3. This should get spidered better from the search engines and make all the URL's "cleaner" to the user.

What I want to know from all you security experts is whether it is perfectly safe or not. The way I do it is to have the individual news.php and content.php files simply set some appropriate variables and then include the modules.php file directly to handle all the normal nuke permissions and security.

Here is the code for almost all of the individual news.php, content.php, etc. files:
Code:
// Function to capitalize the first letter of a string
function recase($string) {
return preg_replace('/\b(\d*)([a-z])/e', '"$1".ucfirst("$2")', strtolower($string));
}

// Set the module name to the name of this file, but capitalize the first letter
$name = recase(basename(__FILE__, ".php"));
$_REQUEST['name'] = $name;

// Require inclusion of the modules.php file so we get our security checks
// and everything we need prior to calling a modules files directly
require_once("modules.php");


So is this safe? Thanks in advance!
Find all posts by timnicholsonView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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 © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.159 Seconds - 349 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::