What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » php helpage

php helpage
Author: Message:
lordy
Senior Member
****


Posts: 853
Reputation: 24
34 / Male / Flag
Joined: Jul 2004
Status: Away
O.P. php helpage
I've seen one some sites and i swear i've read how to do it somewhere but i dont remember where, but you can access a page by going www.example.com/file.php/directory/blah

Can someone point me to the right place in the PHP man or some other site that explains how to do this? I can't find it anywhere xD
05-22-2006 11:56 AM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: php helpage
$_SERVER['PATH_INFO'] = the /directory/blah thing, do with it what you will :P
05-22-2006 12:01 PM
Profile PM Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: php helpage
I think you mean you want it like directory's instead of ? and &, I think you need mod_rewrite then
[Image: 1-0.png]
             
05-22-2006 03:11 PM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: php helpage
Yes, that's probably the best option, because $_SERVER['PATH_INFO'] isn't reliable (however, it will work on most servers).

Take a look at this page for more info about the URL rewrite engine.
05-22-2006 09:25 PM
Profile E-Mail PM Find Quote Report
lordy
Senior Member
****


Posts: 853
Reputation: 24
34 / Male / Flag
Joined: Jul 2004
Status: Away
O.P. RE: php helpage
can you explain to me why $_SERVER['PATH_INFO'] isn't reliable?

The mod_rewrite thing looks a bit complex for me I think :P
05-22-2006 09:39 PM
Profile E-Mail PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: php helpage
http://www.php.net/manual/en/reserved.variables.p...d.variables.server

This post was edited on 05-23-2006 at 10:11 AM by J-Thread.
05-23-2006 10:10 AM
Profile E-Mail PM Find Quote Report
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: php helpage
It looks like you are making a script that takes the path of the desired content from the URL, then sends that content to the client.  While there are valid uses for that and it can be done safely, be careful or you will get in trouble.

The problem with such scripts is that, without additional code to validate the path, they can be easily manipulated to read anything on the server -- overriding the server's built-in security restrictions, things like .htaccess and so forth.

This is just a mandatory security note: it doesn't mean you shouldn't do it, just make sure you do it right.  :p
05-23-2006 02:40 PM
Profile E-Mail PM Find Quote Report
ipab
Veteran Member
*****

Avatar
Design Evolved

Posts: 1017
Reputation: 32
34 / Male / Flag
Joined: May 2004
RE: php helpage
I looked into this over the weekend for my site, coudn't do it properly, so I got dt to help :D. You can try asking him, perhaps he will assist you.
56656E692C 20566964692C 2056696369
05-23-2006 04:01 PM
Profile E-Mail PM Web Find Quote Report
TheSteve
Full Member
***

Avatar
The Man from Japan

Posts: 179
Reputation: 23
40 / Male / Flag
Joined: Aug 2005
RE: php helpage
You can use the 'REQUEST_URI' server variable.

For example in the URL
http://www.somewhere.com/index.php/bob/red.png

$_SERVER['REQUEST_URI'] would be /index.php/bob/red.png

And this code should get just the /bob/red.png at the end.
code:
<?php
$filename = "index.php";
$request = strstr($_SERVER['REQUEST_URI'],$filename);
$request = strstr($request,"/");
?>

See this implementation
http://www.baxteronline.com/uriviewer.php/this/is/a/test
05-23-2006 11:15 PM
Profile PM Web Find Quote Report
lordy
Senior Member
****


Posts: 853
Reputation: 24
34 / Male / Flag
Joined: Jul 2004
Status: Away
O.P. RE: php helpage
quote:
Originally posted by ipab
I looked into this over the weekend for my site, coudn't do it properly, so I got dt to help :D. You can try asking him, perhaps he will assist you.
I understand how to do it now, I just needed the info :P

I understand what Adeptus is saying too, and I don't reall wan to risk that, so it looks like I should go with what I was going to do and try and make that section of my site database driven instead :P

I've not done much with databases, so it will be a learning experience for me :P
05-24-2006 12:48 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On