Domain Manage

Help with simple html please - i need an expert

Discussion in 'Website Design' started by Alpha, Aug 18, 2005.

Thread Status:
Not open for further replies.
  1. Alpha

    Alpha Active Member

    Joined:
    Aug 2005
    Posts:
    125
    Likes Received:
    3
    I want to display the current url of the page on the webpage, is there a command to do this in html?

    i did find a javascript to do it, it worked in ie, but not firefox?

    help anyone please?
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
     
  3. aquanuke

    aquanuke Well-Known Member

    Joined:
    May 2005
    Posts:
    2,019
    Likes Received:
    34
    best way would be with PHP.

    <?$hostname = $_SERVER['HTTP_HOST'];?>
    <?echo $hostname?>

    Just put that in your page and rename it mypage.php

    Or if you still want it to be mypage.html then put this in your .htaccess file

    AddType application/x-httpd-php .php .html
    Options +FollowSymlinks

    That will make html files parse as php files.
     
    Last edited: Aug 18, 2005
  4. charlie

    charlie Well-Known Member

    Joined:
    Jul 2004
    Posts:
    2,613
    Likes Received:
    25
    In ASP this would be :
    Response.write( "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") ) & "?" & Request.ServerVariables("QUERY_STRING") ) %>
     
  5. Alpha

    Alpha Active Member

    Joined:
    Aug 2005
    Posts:
    125
    Likes Received:
    3
    thanks.

    what if I am url forwarding the domain using frames, (the browser still shows the originally typed domain name, but in fact you are on a different page)

    .. is it possible to display the url i originally keyed ?
     
  6. fredo

    fredo Active Member

    Joined:
    Aug 2005
    Posts:
    104
    Likes Received:
    1
    I know a tricky way to do it in HTML: you need to create a frame of 1 pixel high at the top of your page and display your content in a second frame, which would take the rest of the screen. I hope it helps !
     
  7. rob

    rob Founding Member

    Joined:
    Jan 2005
    Posts:
    5,953
    Likes Received:
    68
    make the frame redirect to www.newdomain.com/?domainname=original.co.uk

    then <? echo "$domainname"; ?> in PHP.

    Cheers,
    Rob.
     
Thread Status:
Not open for further replies.

Share This Page