raduenea Posted September 9, 2014 Share Posted September 9, 2014 Hi, Can you please tell me in witch conditions should be used base tag. If have a website that base tag it's define in header like: <base href="http://www.website.com/"> What's the meaning of this ? Thank you 1 Quote Link to comment https://forums.phpfreaks.com/topic/290943-meaning-of-base-tag/ Share on other sites More sharing options...
Jacques1 Posted September 9, 2014 Share Posted September 9, 2014 Did you read the manual? Quote Link to comment https://forums.phpfreaks.com/topic/290943-meaning-of-base-tag/#findComment-1490464 Share on other sites More sharing options...
deathbeam Posted September 9, 2014 Share Posted September 9, 2014 It will change to what url will point relative urls in your document. F.E when your domain is www.example.com, this relative path <a href="test">Test relative link</a> will point to www.example.com/test. But if you will change base to f.e this one <base href="http://www.new_example.com/"> "Test relative link" will point to www.new_example.com/test Quote Link to comment https://forums.phpfreaks.com/topic/290943-meaning-of-base-tag/#findComment-1490493 Share on other sites More sharing options...
raduenea Posted September 10, 2014 Author Share Posted September 10, 2014 Can be used as an absolute pah inside in php script for all folders (images, admin, etc) ? Or is another better solution. Quote Link to comment https://forums.phpfreaks.com/topic/290943-meaning-of-base-tag/#findComment-1490551 Share on other sites More sharing options...
Solution deathbeam Posted September 10, 2014 Solution Share Posted September 10, 2014 If you are echoing PHP values to html and you need to rewrite all relative links then yes, this is probably best method. Otherwise use simple string merging and echo values with var like $newURL. before them Quote Link to comment https://forums.phpfreaks.com/topic/290943-meaning-of-base-tag/#findComment-1490554 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.