Log in

View Full Version : grab current pages url



cyote101
03-19-2010, 09:44 PM
hello, I have some Java and php scripts i would like to put on my pages but i do not want to have to edit the code for each page. In such scripts there is a target url. I would like to put some sort of code there that automatically detect the url it's being displayed on and then interject it into the code.

And on another note. I would like to know if it's possible to automatically name a websites Title bar by the name of an image in an image holder?


does that sound right? Anyways does anyone know how to do that?

Thanks again folks your help has been great!

bluewalrus
03-19-2010, 10:14 PM
$where_am_i = "http://" . $_server['HTTP_HOST'] . $_server['PHP_SELF'];

more info http://php.net/manual/en/reserved.variables.server.php

cyote101
03-19-2010, 10:29 PM
Thanks so that script is for php. does anyone know any way for javascript.

bluewalrus
03-20-2010, 07:20 AM
Well php processes before javascript so just parse it before and echo the result to the javascript where needed.

cyote101
03-20-2010, 08:19 AM
wow did not know that. Very cool. I'll check that out.

djr33
03-20-2010, 08:41 PM
That's a good way to do it. If you for some reason can't use PHP, it's also possible using Javascript. From a quick google search, here's a tutorial:
http://www.soundfeelings.com/free/current_url.htm

MarCn
04-25-2010, 08:36 AM
hello, I have some Java and php scripts i would like to put on my pages but i do not want to have to edit the code for each page. In buy phentermine cheap (http://www.buyphenterminecheap.com/buy-phentermine-cheap.htm) such scripts there is a target url. I would like to buy cheap tadalafil (http://www.cheaptadalafil.co.uk/cheap-tadalafil.htm) put some sort of code there that automatically detect the url it's being displayed on and then interject it into the code.

And on another note. I would like to know if it's possible to automatically name a websites Title bar by the name of an image in an image holder?


does that sound right? Anyways does anyone know how to do that?

Thanks again folks your help has been great!



Thanks djr33 for the link! Finally I found example :)

akitodito
04-27-2010, 07:37 AM
Is there anyway to find or figure out what the .FLV url is for Myspace videos or any other flv site?
Code: