Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Extract direct link from php file
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
gentoonewb39
Guru
Guru


Joined: 28 Jul 2005
Posts: 317

PostPosted: Tue Jun 27, 2006 12:29 pm    Post subject: Extract direct link from php file Reply with quote

Hi one webserver that I frequently use uses the download method of having the files linked to as www.foo.com/some.php/someotherfile.zip is there anyway I can find/extract a direct link to the someotherfile.zip?

PS No I don't intended to use this for hotlinking.
Back to top
View user's profile Send private message
martin.k
Guru
Guru


Joined: 28 Nov 2004
Posts: 493
Location: Wylatowo, Polska

PostPosted: Tue Jun 27, 2006 12:55 pm    Post subject: Reply with quote

What for ???
_________________
linux-2.6.17 +ck +R4 +lockless +genetic-as +... więcej nie pamiętam :)
LRU #299256
Back to top
View user's profile Send private message
gen2fox
Guru
Guru


Joined: 25 May 2004
Posts: 544

PostPosted: Tue Jun 27, 2006 12:59 pm    Post subject: Reply with quote

It may not be possible if they store the files in a directory outside public_html (or whatever it's called).
_________________
python>>> q="'";s='q="%c";s=%c%s%c;print s%%(q,q,s,q)';print s%(q,q,s,q)
blog
Back to top
View user's profile Send private message
gentoonewb39
Guru
Guru


Joined: 28 Jul 2005
Posts: 317

PostPosted: Tue Jun 27, 2006 1:20 pm    Post subject: Reply with quote

@gen2fox
The files are availibale to the public so dosn't that mean that they are inside the public_html?
Back to top
View user's profile Send private message
Cocker68
Apprentice
Apprentice


Joined: 16 Jan 2003
Posts: 227
Location: Germany

PostPosted: Tue Jun 27, 2006 1:37 pm    Post subject: Reply with quote

gentoonewb39 wrote:
The files are availibale to the public so dosn't that mean that they are inside the public_html?
No. apache can only reach files in a defined document-root-dir, whereever PHP is able to reach files from the whole filesystem.
They probably use kind of URL-rewriting from www.foo.com/some.php/someotherfile.zip to www.foo.com/some.php?parameter=someotherfile.zip and PHP can lookup this file in /downloads/someotherfile.zip for example.

- Cocker :wq
Back to top
View user's profile Send private message
gen2fox
Guru
Guru


Joined: 25 May 2004
Posts: 544

PostPosted: Tue Jun 27, 2006 2:53 pm    Post subject: Reply with quote

Cocker68 wrote:
gentoonewb39 wrote:
The files are availibale to the public so dosn't that mean that they are inside the public_html?
No. apache can only reach files in a defined document-root-dir, whereever PHP is able to reach files from the whole filesystem.
They probably use kind of URL-rewriting from www.foo.com/some.php/someotherfile.zip to www.foo.com/some.php?parameter=someotherfile.zip and PHP can lookup this file in /downloads/someotherfile.zip for example.

- Cocker :wq


No need for a rewrite rule by the way, requesting foo.php/bar does call foo.php, in this case "bar" can be accessed via $_SERVER['REQUEST_URI'].
_________________
python>>> q="'";s='q="%c";s=%c%s%c;print s%%(q,q,s,q)';print s%(q,q,s,q)
blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
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