[ Upss @ 10.12.2006. 00:45 ] @
Postoji li mogucnost da procitam cijelu vrijednost iz adres bara i da to spremim u neku promjenljivu. |
[ Upss @ 10.12.2006. 00:45 ] @
[ Miroslav Ćurčić @ 10.12.2006. 00:55 ] @
Teško, PHP je jezik koji se izvršava na serveru, a tamo nema "adres bara".
[ sale83 @ 10.12.2006. 01:03 ] @
http://au3.php.net/reserved.variables - Baci malo pogled.... [ Nemanja Avramović @ 10.12.2006. 01:05 ] @
Mislim da ne može tek tako, ali možeš da je "napraviš"
![]() Code: $query = ($_SERVER['QUERY_STRING']) ? "?" . $_SERVER['QUERY_STRING'] : ''; $addressbar = "http://".$_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . $query; echo $addressbar; $addressbar ti sadrži celu putanju ovako. Odnosno trebalo bi da sadrži ![]() p.s. Ovo radi samo ako je putanja normalnog tipa, odnosno http://sajt.com/folder/fajl.php ili http://sajt.com/folder/fajl.php?parametri... [ sale83 @ 10.12.2006. 01:56 ] @
Pa moze da koristi REQUEST_URI....
Code: $adbar = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; Poz sale [ Upss @ 10.12.2006. 08:32 ] @
E te o je ono što mi treba. Ovo radi.
Ovo mi treba da pamtim url prethodne stranice. Mučim se sa jednim problemom već par dana a to je da kad korisnik klikne na odredjeni link na sajtu i ako je stranica koju treba da otvori prazna (recimo rezultat nekog upita) hocu da mu prikazem prethodu stranu a ne praznu stranu. Ne znam dali postoji neko bolje rešenje. Kako sad da url koji je smješten u ovu promjenljivu da iskoristim da startujem neku stranicu. [ centaur @ 10.12.2006. 08:42 ] @
[ Upss @ 11.12.2006. 23:10 ] @
Pazite sad ovo...
Funkcija header super radi ali u mom slučaju pravi veliki problem. Ovo je kod koji radi... <? header("Location: http://localhost/Test.php"); ?> Ukoliko imam određenu "količinu" koda prije ove funkcije neće da radi ne znam zašto. Kad kažem količinu koda ne mislim na broj redova nego sam ustanovio da se radi o broju karaktera. Neznam dali je to normalno ili je bug moje verzije php-a. Verzija je 4.3.1. Evo jednog jednostavnog primjera. Mozda ovaj primjer ima malo više koda ali mi je vazno da neko od vas to isproba kod sebe. Ovaj kod što ću postaviti automatski izvrši reditrekciju na stranicu test.php. Ukoliko dodam samo još jedan znak u html kod iznad funkcije redirekcije nema i samo se prikazuje ova početna stranica. Evo i koda: <?php ?> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table width='750' height='20' border='1'> <tr> <td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td><td width='150'></td> </tr> </table> <table border='1'> <tr> <td> </td> </tr> </table> <? header("Location: http://localhost/Test.php"); ?> [ sale83 @ 11.12.2006. 23:32 ] @
[ w3bl0rd @ 12.12.2006. 10:02 ] @
toplo preporučam da pročitaš manual...
prije header funkcije nesmije biti nikakvog ispisa... ako baš nećeš čitat manual možeš bar pogledat određenu funkciju koja te zanima jer ovako nikad nećeš ništa napravit! [ Jezdimir Lončar @ 12.12.2006. 10:38 ] @
Header f-ju možeš koristiti prije html outputa.
To važi i za setcookie, session_start itd. Međutim, za redirect možeš koristiti i javascript ali i html: <meta http-equiv="refresh" content="0;URL=strana.php" /> 0 je br. sekundi prije redirecta. Ostalo valjda znaš... Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|