shyguy0507 Posted March 27, 2007 Share Posted March 27, 2007 Hi, I'm sorry if this has already been posted, a search of the forum didn't turn anything up so i'll ask away. I'm trying to fetch urls from a document on my server and convert them into absolute urls. I can extract them but some of my links use ../ or ./. I think i've solved the ./ one but I can't find anything on getting the url when ../ is used. As an example some urls use ../index.php when in a directory so http://www.example.com/dir/test.php, so a url of ../index.php from here would land the user on http://www.example.com/index.php. At the moment it's landing on http://www.example.com/../index.php. Any ideas? Help would be appreciated Quote Link to comment https://forums.phpfreaks.com/topic/44466-converting-a-relative-url-to-an-absolute-url/ Share on other sites More sharing options...
only one Posted March 27, 2007 Share Posted March 27, 2007 you dont make much sense Quote Link to comment https://forums.phpfreaks.com/topic/44466-converting-a-relative-url-to-an-absolute-url/#findComment-215963 Share on other sites More sharing options...
mrwebmaster Posted April 17, 2011 Share Posted April 17, 2011 Here's a script that allows you to convert relative URL to their absolute counterpart: http://web-o-blog.blogspot.com/2011/04/function-absoluteurlbaseurl-relativeurl.html Quote Link to comment https://forums.phpfreaks.com/topic/44466-converting-a-relative-url-to-an-absolute-url/#findComment-1202557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.