The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP & CPanel Related Question

Discussion in 'General Discussion' started by ukhost, Oct 12, 2002.

  1. ukhost

    ukhost Well-Known Member

    Joined:
    Jan 8, 2002
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    PHP & CPanel Related Question

    Hi,

    I'm looking at createing a php page that I can place in the skeleton dir to copy to each account as it is created.

    What I am look for is the php code to get the url the user has entered and display this somewhere in the document!

    Any ideas?

    Kind Regards,

    Neil
     
  2. TomB

    TomB Member

    Joined:
    Sep 3, 2002
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    I snagged this bit of code off of this board I think... hope this helps.

    &?php
    $data = explode(&.&, $GLOBALS[&HTTP_HOST&]);
    $domain = $data[1] . &.& . $data[2];
    echo &&html&&title&$domain&/title&&body&&;
    echo &The domain &B&$domain&/B& is Under Construction &/body&&/html&&;
    ?&

    Tom
     
  3. Holbrookau

    Holbrookau Active Member

    Joined:
    Aug 23, 2002
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Here's the one I use - in java:

    &SCRIPT LANGUAGE=&JavaScript&&
    &!-- Begin
    {
    document.write(location.href);
    }
    // End --&
    &/SCRIPT&

    Just put that anywhere you want the address to appear.
     
  4. JustinK

    JustinK Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    251
    Likes Received:
    0
    Trophy Points:
    16
    [quote:e4d6cb2fbe][i:e4d6cb2fbe]Originally posted by TomB[/i:e4d6cb2fbe]

    I snagged this bit of code off of this board I think... hope this helps.

    &?php
    $data = explode(&.&, $GLOBALS[&HTTP_HOST&]);
    $domain = $data[1] . &.& . $data[2];
    echo &&html&&title&$domain&/title&&body&&;
    echo &The domain &B&$domain&/B& is Under Construction &/body&&/html&&;
    ?&

    Tom[/quote:e4d6cb2fbe]

    I'm not quite understanding that code since you split it via the period and then the period you just split it by back in... this is the example I give for users to use:

    [quote:e4d6cb2fbe]
    &html&
    &head&
    &title&Welcome to &?=$_SERVER[&HTTP_HOST&]?&&/title&
    &/head&
    &body&
    Welcome to &?=$_SERVER[&HTTP_HOST&]?&!
    Your domain is now pointing to _insert hostname here_ .
    _insert more info here_
    &/body&
    &/html&
    [/quote:e4d6cb2fbe]
     
  5. ukhost

    ukhost Well-Known Member

    Joined:
    Jan 8, 2002
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Hi Folks,

    Thanks for the code snippets, will go and build my page now! :)

    Kind Regards,

    Neil
     
Loading...

Share This Page