Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Kako pročitati url iz adres bara

[es] :: PHP :: Kako pročitati url iz adres bara

[ Pregleda: 3628 | Odgovora: 10 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Upss

Član broj: 44495
Poruke: 29
*.pttrs.net.



+1 Profil

icon Kako pročitati url iz adres bara10.12.2006. u 00:45 - pre 211 meseci
Postoji li mogucnost da procitam cijelu vrijednost iz adres bara i da to spremim u neku promjenljivu.
 
Odgovor na temu

Miroslav Ćurčić
ex mVeliki
Novi Sad

Član broj: 19034
Poruke: 1118
*.dynamic.sbb.co.yu.



+19 Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 00:55 - pre 211 meseci
Teško, PHP je jezik koji se izvršava na serveru, a tamo nema "adres bara".
"The quieter you become, the more you are able to hear."
Blog | PowerCMS
 
Odgovor na temu

sale83
Australia
Sydney

Član broj: 41625
Poruke: 729
*.ispone.net.au.



+30 Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 01:03 - pre 211 meseci

http://au3.php.net/reserved.variables - Baci malo pogled....
Sto mozes danas ne ostavljaj za sutra!
 
Odgovor na temu

Nemanja Avramović
Engineering Manager
MENU Technologies
Beograd, Srbija

Moderator
Član broj: 32202
Poruke: 4391
194.106.174.*

Sajt: https://avramovic.info


+46 Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 01:05 - pre 211 meseci
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...
Laravel Srbija.

[NE PRUŽAM PODRŠKU ZA PHP PREKO PRIVATNIH PORUKA!]
 
Odgovor na temu

sale83
Australia
Sydney

Član broj: 41625
Poruke: 729
*.ispone.net.au.



+30 Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 01:56 - pre 211 meseci
Pa moze da koristi REQUEST_URI....

Code:

$adbar = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];


Poz
sale




Sto mozes danas ne ostavljaj za sutra!
 
Odgovor na temu

Upss

Član broj: 44495
Poruke: 29
*.pttrs.net.



+1 Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 08:32 - pre 211 meseci
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.
 
Odgovor na temu

centaur
Beograd

Član broj: 65691
Poruke: 407
80.93.253.*

ICQ: 249678363
Sajt: www.pavko.net


+24 Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 08:42 - pre 211 meseci
http://www.php.net/manual/en/function.header.php
Powered by Slackware 13
 
Odgovor na temu

Upss

Član broj: 44495
Poruke: 29
*.pttrs.net.



+1 Profil

icon Re: Kako pročitati url iz adres bara11.12.2006. u 23:10 - pre 211 meseci
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");
?>
 
Odgovor na temu

sale83
Australia
Sydney

Član broj: 41625
Poruke: 729
*.ispone.net.au.



+30 Profil

icon Re: Kako pročitati url iz adres bara11.12.2006. u 23:32 - pre 211 meseci
Nije to BUG...


http://www.elitesecurity.org/t96073-0#1348151

Poz
sale
Sto mozes danas ne ostavljaj za sutra!
 
Odgovor na temu

w3bl0rd
Varaždin, Hrvatska

Član broj: 82659
Poruke: 380
*.cmu.carnet.hr.



+26 Profil

icon Re: Kako pročitati url iz adres bara12.12.2006. u 10:02 - pre 211 meseci
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!
there's no place like 127.0.0.1
 
Odgovor na temu

Jezdimir Lončar
Aka Blazeme
PHP/jQuery Dev, BildStudio
Crna Gora / Pljevlja

Član broj: 74833
Poruke: 674
195.189.142.*

Jabber: jezdonet@gmail.com


+4 Profil

icon Re: Kako pročitati url iz adres bara12.12.2006. u 10:38 - pre 211 meseci
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š...
“I never think of the future - it comes soon enough.” - Albert Anštajn (Albert Einstein)
 
Odgovor na temu

[es] :: PHP :: Kako pročitati url iz adres bara

[ Pregleda: 3628 | Odgovora: 10 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.