Jump to content

$_SERVER['SERVER_NAME'] and require function


visualazza

Recommended Posts

hey,

 

i have been trying all day to get something to work that will allow me to replicate the / part of an href

<a href="/images/blah.jpg">

to go from the root folder in php.

 

i thought the easiest way to do this is to use php to get the domain address.

 

require($_SERVER['SERVER_NAME']."/header.php");

 

i have gotten to this part but am still getting the error that the file doesnt exist probably because there is no http:// in front of it but i do not want to turn allow_url_includes on in the php.ini file.

 

How can i acheive this?

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/210734-_serverserver_name-and-require-function/
Share on other sites

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.