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: 995 | Odgovora: 10 ]

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Upss

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



Profil

icon Kako pročitati url iz adres bara10.12.2006. u 00:45

Postoji li mogucnost da procitam cijelu vrijednost iz adres bara i da to spremim u neku promjenljivu.
10.12.2006. u 00:45 

mVeliki
Miroslav Ćurčić
Novi Sad

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



Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 00:55
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."
10.12.2006. u 00:55 

sale83
Aleksandar Ervacanin
Full Time Student & Full Time Zaposlen ( IT Suppo..
Sydney

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

Sajt: www.serbiansite.com


Profil

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

http://au3.php.net/reserved.variables - Baci malo pogled....
PHP/MySQl/SQL/VB.NET/JAVA/JSP/Servlet/MSSQLServer/MSAccess/Perl
COBOL/JCL/CICS -> IBM Mainframe
Nortel/Cisco/SideWinder
10.12.2006. u 01:03 

Nemanja Avramović
PHP developer, Webinsane
Mladenovac, Srbija

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

ICQ: 266136396
Sajt: www.avramovic.info


Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 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...
Moj sajt. Moj blog. Moj avatar. Moj grad. Moja frizura.

[NE PRUŽAM PODRŠKU ZA PHP PREKO PRIVATNIH PORUKA!]
10.12.2006. u 01:05 

sale83
Aleksandar Ervacanin
Full Time Student & Full Time Zaposlen ( IT Suppo..
Sydney

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

Sajt: www.serbiansite.com


Profil

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

Code:

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


Poz
sale




PHP/MySQl/SQL/VB.NET/JAVA/JSP/Servlet/MSSQLServer/MSAccess/Perl
COBOL/JCL/CICS -> IBM Mainframe
Nortel/Cisco/SideWinder
10.12.2006. u 01:56 

Upss

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



Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 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.
10.12.2006. u 08:32 

centaur
Ivan Pavković
web developer, Kaywa AG
Beograd

Član broj: 65691
Poruke: 228
80.93.253.*

ICQ: 249678363
Sajt: www.pavko.info


Profil

icon Re: Kako pročitati url iz adres bara10.12.2006. u 08:42
http://www.php.net/manual/en/function.header.php
Powered by Slackware 12.1
10.12.2006. u 08:42 

Upss

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



Profil

icon Re: Kako pročitati url iz adres bara11.12.2006. u 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. ne znam 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");
?>
11.12.2006. u 23:10 

sale83
Aleksandar Ervacanin
Full Time Student & Full Time Zaposlen ( IT Suppo..
Sydney

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

Sajt: www.serbiansite.com


Profil

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


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

Poz
sale
PHP/MySQl/SQL/VB.NET/JAVA/JSP/Servlet/MSSQLServer/MSAccess/Perl
COBOL/JCL/CICS -> IBM Mainframe
Nortel/Cisco/SideWinder
11.12.2006. u 23:32 

w3bl0rd

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



Profil

icon Re: Kako pročitati url iz adres bara12.12.2006. u 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!
internet is my kingdom but google is my god
12.12.2006. u 10:02 

Neohacker
Jezdimir Lončar
Crna Gora / Pljevlja

Član broj: 74833
Poruke: 538
195.189.142.*

Jabber: neohacker@elitesecurity.org
ICQ: 354779968
Sajt: www.jezdo.net


Profil

icon Re: Kako pročitati url iz adres bara12.12.2006. u 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š...
“I never think of the future - it comes soon enough.” - Albert Anštajn (Albert Einstein)
PHP Diskusije, tutoriali i skripte
“Dobri programeri pišu kvalitetan kod, najbolji ne pišu, koriste skripte ovih prvih.” - mVeliki

2.1.2008. sam cijelu noć proveo kodirajuci. : (
3.1.2008. opet sam cijelu noć proveo kodirajuci. : (
12.12.2006. u 10:38 

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

[ Pregleda: 995 | Odgovora: 10 ]

Postavi temu Odgovori

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