PHP: Skipping index page call in URL Sep23 '05
A page request sometimes relies on a variable in the URL string.
For example, an Administration page I am maintaining has an address of:
http://www.mypage.com/admin/
Within the admin folder, there is an index.php file, which handles all requests.
To allow for a dynamic template, I have a variable within index.php called page, which is used to pull the proper content.
So, a typical request could look like this:
http://www.mypage.com/admin/index.php?page=products
Except, it’s also OK to skip the index.php? part entirely, and go directly to the page variable:
http://www.mypage.com/admin?page=products
So, in this case, the index.php part is inferred. This is a nice way to shorten up your URI requests.
Categories: Efficiency
, PHP
, Tutorials
, Web Development ![]()
Add Feedback (view all)
Leave feedback
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from a suburb of Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Popular Pages
- Fast rounded corners in Photoshop (7873 recent visits)
- PHP – passing variables across pages (2857 recent visits)
- JavaScript set selected on load (2345 recent visits)
- Removing all child nodes from an element (1704 recent visits)
- iPod songs out of order? (1412 recent visits)
- Firefox 3 smart address bar: wildcard search (1300 recent visits)
- Britney - Everytime piano tab (1180 recent visits)
- MySQL LEFT JOIN syntax (971 recent visits)
- Breathe Me - Sia (824 recent visits)
- Tumblr: how blogging should be (727 recent visits)
Similar Entries
- PHP project: convert times to numbers (107 recent visits)
- PHP – passing variables across pages (2857 recent visits)
- Install Apache, PHP, MySQL on Windows (36 recent visits)
- Code mnemonics: PHP implode/explode (110 recent visits)
- Swap banner image with CSS and PHP (243 recent visits)
- PHP date formatting ass backwards (49 recent visits)
Stats
47 unique visits since August 2008
Recent Referrers (click)
- inurl admin.php
- inurl: admin.php
- inurl:
- inurl
- intitle: admin.php
- call a new page php
- php calling a new page
- php pass variable in url show in page
- inurl/admin.php
- inurl/admin.php
- code inurl: admin.php
- inurl.admin.php
- inurl=.index.php?
- inurl./admin.php
- need to call index.php in url
- skipping index pages
- inurl: index.php
- inurl: admin/index.php