Results 1 to 8 of 8

Thread: grab current pages url

  1. #1
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default grab current pages url

    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!
    Last edited by cyote101; 03-19-2010 at 10:08 PM.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    PHP Code:
    $where_am_i "http://" $_server['HTTP_HOST'] . $_server['PHP_SELF']; 
    more info http://php.net/manual/en/reserved.variables.server.php
    Corrections to my coding/thoughts welcome.

  3. The Following User Says Thank You to bluewalrus For This Useful Post:

    cyote101 (03-19-2010)

  4. #3
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks so that script is for php. does anyone know any way for javascript.
    Last edited by cyote101; 03-19-2010 at 10:45 PM.

  5. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Well php processes before javascript so just parse it before and echo the result to the javascript where needed.
    Corrections to my coding/thoughts welcome.

  6. #5
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    wow did not know that. Very cool. I'll check that out.

  7. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. The Following User Says Thank You to djr33 For This Useful Post:

    MarCn (04-25-2010)

  9. #7
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by cyote101 View Post
    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 such scripts there is a target url. I would like to buy cheap tadalafil 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
    Last edited by MarCn; 05-02-2010 at 08:46 AM.

  10. #8
    Join Date
    Apr 2010
    Location
    UK
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default grab current pages url

    Is there anyway to find or figure out what the .FLV url is for Myspace videos or any other flv site?
    Code:

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •