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
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
Link to comment
Share on other sites

[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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.