SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old June 13th, 2004, 01:31 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
including a folder

hi. How do i include what ever comes after the "/" in my domainname ?... so that i dont have to write "http://domain/?page=pageName.php" but can write "http://domain/pageName" and then it treats it like a .php file and includes it in the given include(); function. ???

- Pheifel

Reply With Quote
  #2  
Old June 14th, 2004, 11:59 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
There is a mod for apache that you can use to do that.. it's installed here on devarts, or at least it was, for viewing the articles.. give me some time, i'll do my research and find out what it is called again.. or maybe one of the other mods knows off the top of their heads what it is called.

*Edit*

I found what i was looking for, please reference this thread and let me know if you have any other questions

Reply With Quote
  #3  
Old June 15th, 2004, 10:41 PM
KonaBreath KonaBreath is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 4 KonaBreath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
mod_rewrite

Reply With Quote
  #4  
Old June 16th, 2004, 10:49 AM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
well... the point is, that i dont have physical acces to the server. Is ther no way to code the php tag to take enything after the last "/" and convert into "*.php" ??

- Pheifel

Reply With Quote
  #5  
Old June 16th, 2004, 02:35 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
It's possible that you could pass everything through index.php and use the PATH_INFO environment variable to grab whatever's on the end. So in index.php, you'd have something like the following:

PHP Code:
 $path=getenv("PATH_INFO");
if(
file_exists($path ".php")){
    include(
$path ".php");
}
else{
    print 
"You have requested a file that does not exist.";



In short, if you don't provide a file name (index.php), many servers will assume index.php without rewriting the URL. The PATH_INFO environment variable consists of whatever follows a slash after the URI. So if you had a file named test.php in your directory that contained the text "This is a test" and you used the code above, browsing to http://localhost/test, you should get a page that reads "This is a test."
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #6  
Old June 16th, 2004, 02:37 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
You should always be very careful, incidentally, about what you allow people to include. You might add code to split $path on slashes, for example, and take only the last element, forcing a check for that filename within the current directory. This prevents people from being able to specify filenames outside the directory you want them to have access to. Always validate, in other words.

Reply With Quote
  #7  
Old June 17th, 2004, 03:06 AM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
thanx


- pheifel

Last edited by Pheifel : June 17th, 2004 at 04:33 AM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > including a folder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway