Forum Moderators: coopster
Code is: $_PATH1="http://" . $_SERVER['HTTP_HOST']."/";
Why I have to add on link for images also / that it will work as it is already there / in
Link is like. <img src="<?=$_PATH1?>images/myimage.jpg" ></a>
The way i would usually do it is to have a config file that gets included in every page, and declare them as global variables. eg,
define("SITEPATH", "http://www.example.com/");
define("DOCROOT", "/home/site/path/to/your/site/");
Then do like you are doing,
<img src="<?php echo SITEPATH;?>images/myimage.jpg" >
Ally