thepip3r Posted January 7, 2009 Share Posted January 7, 2009 how is that done? is it some server variable they're interpreting?? if so, what "page" is it that you can use to write custom code to evaluate that variable?? do you have to change your default web server error pages to look for that? please help me out with a general direction on how something like: http://en.wikipedia.org/wiki/Operation_Northwoods ...i'm guessing it's not that they individuall create some crazy folder structure on the web server... any help would be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/139914-solved-php-paths-as-variable-arguments-like-wikipedia/ Share on other sites More sharing options...
Brian W Posted January 7, 2009 Share Posted January 7, 2009 umm, not sure what you are getting at, but I'll take a shot in the dark. create a folder called "pages". Create a file called Default.html and write some html in it like: <h2>Welcome</h2> create a file called "hello.html" and write some html in it like: Good Job<b>!!!</b> In the page you want people to go to where they will be calling these files, do something like this: <?php $page = "Default"; if(isset($_GET['Page']) && is_file("pages/".$_GET['Page'].".html")){ //CHECK THAT THE FILE EXISTS $page = $_GET['Page']; } include("pages/".$page.".html"); ?> then link to those page like <a href="index.php?Page=hello">Hello page</a> try that if that is anything like what you are looking for Quote Link to comment https://forums.phpfreaks.com/topic/139914-solved-php-paths-as-variable-arguments-like-wikipedia/#findComment-732004 Share on other sites More sharing options...
thepip3r Posted January 7, 2009 Author Share Posted January 7, 2009 no i understand how to pass varirable arguments with PHP. My question is... like wikipedia with doesn't use the somepage.php?url=blah&something=something_else -- their arguments look specifically a folder structure. my question is, if they are not actually created a folder structure for every one of their arguments, how do i intercept the incoming request to the webserver that would look like it was trying to read the default or index file off of the folder structure? just like wikipedia... Quote Link to comment https://forums.phpfreaks.com/topic/139914-solved-php-paths-as-variable-arguments-like-wikipedia/#findComment-732009 Share on other sites More sharing options...
Brian W Posted January 7, 2009 Share Posted January 7, 2009 ooohh, sorry. That is called URL Rewritting. That is a server function of some sort. Apache does it very easliy supposidly but most other servers also have the ability to do so. Wish I could give you some more info, but never worked with it personally. Quote Link to comment https://forums.phpfreaks.com/topic/139914-solved-php-paths-as-variable-arguments-like-wikipedia/#findComment-732021 Share on other sites More sharing options...
thepip3r Posted January 7, 2009 Author Share Posted January 7, 2009 that might be enough.. i'll do some research on URL rewriting and post my findings once I get something definitive. thanx for the direction. Quote Link to comment https://forums.phpfreaks.com/topic/139914-solved-php-paths-as-variable-arguments-like-wikipedia/#findComment-732025 Share on other sites More sharing options...
premiso Posted January 7, 2009 Share Posted January 7, 2009 mod_rewrite is what you want to look into. Quote Link to comment https://forums.phpfreaks.com/topic/139914-solved-php-paths-as-variable-arguments-like-wikipedia/#findComment-732026 Share on other sites More sharing options...
thepip3r Posted January 7, 2009 Author Share Posted January 7, 2009 For anyone who's looking into this and has a hosting service where they can only modify the .htaccess file, here is a very good reference taht explains every aspect of what I was looking for -- thanks for the direction Brian. http://roshanbh.com.np/2008/03/url-rewriting-examples-htaccess.html Quote Link to comment https://forums.phpfreaks.com/topic/139914-solved-php-paths-as-variable-arguments-like-wikipedia/#findComment-732028 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.