Jump to content

Taking information out of URL


RagingEagle

Recommended Posts

For my website I need to take the following URL:

http://www.mysite.com/index.php&db_id=2&filename=3.zip

And get the information from filename so that I can display the text "3.zip" on my webpage. I know I can do that with Get however Get only works when it calls the information from the URL bar. The above URL is not going to be in the URL bar but rather actual code on the webpage. Is it possible to do what I want?

Thanks,
RE
Link to comment
https://forums.phpfreaks.com/topic/23145-taking-information-out-of-url/
Share on other sites

No, the OP already said he couldn't use the $_GET array since the string in question is not coming from the URL but from a file. The $_REQUEST array is just a combination of the $_GET and $_POST arrays and would be of no use to the OP.

Ken
[quote author=kenrbnsn link=topic=110657.msg447767#msg447767 date=1160109888]
Take a look at the functions [url=http://us2.php.net/parse_url]parse_url()[/url] and [url=http://us2.php.net/parse_str]parse_str()[/url]. They should do what you want.
[/quote]

I tried using parse_url() before I came here and it didn't work. But I didn't know about parse_str() which worked :). Thanks for the help!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.