View Full Version : href location in php

11-28-2010, 02:25 AM
hi guys

i wana ask how i use php to call my domain?

example my current coding

<link href="./css/style.css" rel="stylesheet" type="text/css" />

when i view source the result will be the same as above

now i need help how call my domain so that i all my file can be call perfectly

example like wordpress

<link rel="shortcut icon" href="<?php echo get_bloginfo('url') ?>/favicon.ico" />

then the result come out is

<link rel="shortcut icon" href="http://www.example.com/v2/wp-content/themes/arras/images/favicon.ico" />

pls advise how to write the php code i read at php.net but i cant understand :(

11-28-2010, 08:54 AM
<link href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/css/style.css" rel="stylesheet" type="text/css" />

11-29-2010, 10:46 AM
thanks problem solve :)