Results 1 to 6 of 6
  1. #1

    Putting URL on page

    Anyone know if it's possible to automatically put the current URL into the page. Say I want a landing page with the domain on it, but don't want to handcraft each page for each domain.

    Thanks in advance

  2. #2
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    The easiest way to do this is with JavaScript:

    Code:
    document.write(location.href);
    Otherwise it's also possible with server-side scripting (e.g. PHP).
    Dave Owen
    MediaCollege.com

  3. #3

    hai

    Just use HTTP_HOST or SERVER_NAME, if you create a file called

    info.php and put in it

    <?php

    phpinfo();

    ?>

    That shows you call the info thats easily accessible

  4. #4
    allenhoward
    Guest
    Quote
    Quote: Dave
    View Post
    The easiest way to do this is with JavaScript:

    Code:
    document.write(location.href);
    Otherwise it's also possible with server-side scripting (e.g. PHP).
    This works well.

  5. #5

    hai

    $HTTP_HOST ought to just do the domain itself, explode() off the www or regex it to strip out the rubbish.

    If you are building a holding page for names it is worth logging everything eg.

    $date = date("l dS of F Y h:i:s A");
    $ip = $_SERVER['REMOTE_ADDR'];
    $browser = $HTTP_USER_AGENT;
    $os = $_ENV["OS"];
    $referer = $HTTP_REFERER ;
    $searchterm = "FRONTPAGE";

    Nice and handy to find out who is visiting site, where they have come from, what they did prior to contacting you etc etc. Logging IP's can be handy to see previous visits as well.

    Others do things far more in depth than the above, but it can be very handy

  6. #6
    Quote
    Quote: Dave
    View Post
    The easiest way to do this is with JavaScript:

    Code:
    document.write(location.href);
    Otherwise it's also possible with server-side scripting (e.g. PHP).
    Thats good... I was not knowing it. just one line script will do this.

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
  •  
Subscribe to us on YouTube