Jump to content

[SOLVED] URL within a URL


chrischen

Recommended Posts

So I'm trying to retrieve URL in http://www.mysite.com/page1.php?url=http://www.yahoo.com in $_GET['url'] when I access that page.

 

However if I do it like above $_GET['url'] it returns http:/www.yahoo.com with a missing slash.

 

If I url encode http://www.yahoo.com (http://www.mysite.com/page1.php?url=http%3a%2f%2fwww.yahoo.com) the %2F (the slash) causes it to fail with

 

"Not Found

 

The requested URL /page1.php?url=http://www.yahoo.com was not found on this server."

 

Running Apache2.2 and Zend Core (latest version).

 

Thanks,

Chris

Link to comment
https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/
Share on other sites

Ok, thanks. Actually I was just gonna take in the www.yahoo.com and add in http:// afterwards. But it's still weird because I have SMF installed on the same server and in one of their URLs they take http:// and it works not only that I type in %2F in their URL (on the same server) and it produces NO ERROR. I hope this doesn't turn out like that time I spent hours trying to figure out what made some of my pages shift left (turned out to be the scrollbar appearing and disappearing).

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.