Pogledajte određenu poruku
Staro 29. 07. 2007.   #27
Pedja
Predrag Supurović
Grand Master
 
Datum učlanjenja: 24.01.2006
Lokacija: Užice
Poruke: 791
Hvala: 3
200 "Hvala" u 12 poruka
Pedja is on a distinguished roadPedja is on a distinguished roadPedja is on a distinguished road
Default

Samo da dopunim:

Kôd:
//
// function url_root ()
// Return root level of site
// This works if function is called from script which is in the root of the site, 
// or if script is included by other script which is in the root.
//
function url_root() {

	$m_result = "http://" . $_SERVER['HTTP_HOST'] . str_replace('\\', '/', dirname ($_SERVER['SCRIPT_NAME']));

	if (substr($m_result, -1,1) !== "/"){
		$m_result .= '/';
	}

	return $m_result;

}
ne bi bio PHP to sto jeste da je kozistentan Razlicito tretira root url i poddirektorijume tako da je moralo jos malo koda da se doda.

Imas srece sto se i ja bas bakcem sa istim problemom. Ideja sa <base href= > koja je izneta ovde mi se bas potrefila tako da mi je sad stvar mnogo jednostavnije od umetanja apsolutnih putanja za ama bas sve na strani.
Pedja je offline   Odgovorite uz citat