Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
url trenutne stranice

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
budha



Joined: 02 Mar 2004
Posts: 1377
Location: Osijek

PostPosted: 09.03.2004 12:58    Post subject: url trenutne stranice Add user to your forum ignore list Reply with quote

Zna li netko kako php-u pomocu javascripta poslati url trenutne stranice?
form.php treba ispisati sa koje je stranice poslan.
Pretpostavljam nešto ovako:

window.open('form.php?link= TU SAD IDE NESTO ','','width=360,height=270');

stranica sa koje je pozivam također je php.

Thx!

_________________
I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they've always worked for me.
Back to top
View user's profile Send private message Visit poster's website
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 09.03.2004 13:11    Post subject: Add user to your forum ignore list Reply with quote

lakse ti je onda na samoj stranici s koje pozivas koristiti:
Code:
<?php echo $_SERVER['PHP_SELF']; ?>

ispisi si to pa ces vidjet sto dobijas, onda ili cijeli window.open poziv echoaj php-om recimo...

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 09.03.2004 13:15    Post subject: Add user to your forum ignore list Reply with quote

Naravno, ako cijelo vrijeme po siteu surfas sa ?link=nesto, onda ti je PHP_SELF nedovoljan, vec si moras ispisat taj $link...

A mozes i javascriptom izbaciti vrijednost:
Code:
document.write(location.href);

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
budha



Joined: 02 Mar 2004
Posts: 1377
Location: Osijek

PostPosted: 09.03.2004 16:18    Post subject: Add user to your forum ignore list Reply with quote

ovo sa location.href odgovara, ali napola Laughing

kompletan href sitea je:
Code:
http://www.blabla.bla?nesto=nesto&nestodrugo=nestodrugo

ali document.location.href mi daje vrijednost
Code:
http://www.blabla.bla?nesto=nesto


probao sam ga stavljati na vise mjesta unutar code-a, ali uvijek dobijem isto...
pokupi mi samo do &

Isto se događa i sa docment.location.search, daje mi samo do "&" znaka.

_________________
I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they've always worked for me.
Back to top
View user's profile Send private message Visit poster's website
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 09.03.2004 16:40    Post subject: Add user to your forum ignore list Reply with quote

onda imas mozda u php-u $_SERVER['REQUEST_URI'], ako furas apache, i ako je konfiguriran tako...

Ili probaj print_r($_SERVER), pa kombiniraj stvari koje imas u tom arrayu, vjerojatno ces moc slozit nesto...

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 09.03.2004 17:04    Post subject: Add user to your forum ignore list Reply with quote

hm ja to rjesavam sa echo $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 09.03.2004 18:17    Post subject: Add user to your forum ignore list Reply with quote

'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

sto je manje-vise kombo PHP_SELF i REQUEST_URI-ja kak je retro_one rekao..
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 09.03.2004 18:47    Post subject: Add user to your forum ignore list Reply with quote

Quote:
HTTP_REFERER: In short, it cannot really be trusted.

Ja se osobno ne bih na to oslanjao, pogotovo ako se radi o nekoj iole bitnijoj formi...

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
budha



Joined: 02 Mar 2004
Posts: 1377
Location: Osijek

PostPosted: 10.03.2004 10:08    Post subject: hvala! Add user to your forum ignore list Reply with quote

Uspio sam napraviti sa js-om (document.location.href).
Problem je bio u tome sto je oblik $link bio "http://www.bla.bla/bla.bla?bla=bla&bla2=bla2", pa ga je pri prosljeđivanju form.php-u uzimao samo do &.
Zaboravio sam potpuno na to Embarassed

_________________
I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they've always worked for me.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group