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.

WHM Skeleton Placeholder

Discussion in 'General Discussion' started by MrMagoo, Nov 15, 2005.

  1. MrMagoo

    MrMagoo Member

    Joined:
    Sep 6, 2005
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I'm trying to setup a simple placeholder page to go in WHM skeleton.

    I would like it to display the domain name that is being visited, e.g. > Welcome to the future home of "domainname"

    Is anyone doing this, and if so, what do I need to put in the page to get it to dynamically display the domain name? Thanks.
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    make your welcome page in php and put the code in below add any other html you choose





    <HTML>
    <HEAD>
    <title>Welcome <? echo $SERVER_NAME; ?></title>

    <? echo $SERVER_NAME; ?>

    </body>
    </html>
     
    #2 dalem, Nov 15, 2005
    Last edited: Nov 15, 2005
  3. MrMagoo

    MrMagoo Member

    Joined:
    Sep 6, 2005
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Did it exactly as you outlined, and it doesn't work for me ???
     
  4. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    woops extra head tag corrected :)
     
  5. leverage

    leverage Registered

    Joined:
    Nov 16, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I tried this on my server,
    but the variable $SERVER_NAME; didn't show anything/blank.

    I need info what module I must turn on/install so that apache
    variable can be shown/retrieve.

    Thanks
     
  6. MrMagoo

    MrMagoo Member

    Joined:
    Sep 6, 2005
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Blank for me as well.
     
  7. Zaf

    Zaf Well-Known Member

    Joined:
    Aug 22, 2005
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Oh and now the <body> tag is missing and so does the closing tag for <HEAD>
     
  8. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    here :) not sure where the confusion lies for you all of the code simplits on this post works for me are you saving as as .php



    <HTML>
    <HEAD>
    <title>Welcome <? echo $SERVER_NAME; ?></title>

    </HEAD>
    <BODY BGCOLOR="#FFFFFF" link="#3333ff" alink="#3333ff" vlink="#3333ff">
    <center>

    <hr width="75%" color="#0000FF">
    <div align="center">
    <p align="center"><b>Welcome This is a place holder For <br>
    </b>
    </div>
    <p align="center"> <b> <font face="Arial" size="5">
    <? echo $SERVER_NAME; ?>
    <br>
    </font> </b> </p>
    <hr width="75%" color="#0000FF">
    <br>



    </body>
    </html>
     
    #8 dalem, Nov 16, 2005
    Last edited: Nov 16, 2005
  9. MrMagoo

    MrMagoo Member

    Joined:
    Sep 6, 2005
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I copied your working example exactly, made an index.php file containing your code, and it still won't work. What am I doing wrong?
     
  10. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    not sure I just copied & pasted it directly from the forums from my last post and place it in a working domain works fine


    http://ydaelite.com/tmp.php
     
  11. ntwaddel

    ntwaddel Well-Known Member

    Joined:
    Nov 3, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Templeton, CA
    you should be using $_SERVER['SERVER_NAME'] instead of $SERVER_NAME :)
     
  12. leverage

    leverage Registered

    Joined:
    Nov 16, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Dear All,

    I want to make clear my question.

    I have many different hosting account and tested the two variable on those domain.

    Some hosting can display both these apache and php variable all together, some can't.

    Here is the two variable that I use:

    Apache ==> $SERVER_NAME
    PHP ==> $_SERVER['SERVER_NAME']

    My question is like this:
    On the hosting that can't display the apache variable $SERVER_NAME,
    how to configure (what module I must install / turn on) so that It can display apache
    variable since my script need to use apache variable insteads of PHP variable.

    I asked my vps hosting support and the didn't have any idea how to fix it.

    I have a few hosting that can display both variable, and a few others hosting can't.

    So, it must be some configuration or module issues that need to be fix to display
    the apache variable.

    I need guidance from some of you who may experienced with server config/module.

    To put it simple, what module or config I must install / turn on so that my hosting
    server can display apache variable $SERVER_NAME.

    It's possible that someday you may need to run script that need this apache variable
    for your customer, so I prefer to fix it now before many clients use this server.

    Thanks
     
  13. leverage

    leverage Registered

    Joined:
    Nov 16, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi Izzee,

    Thanks for the answer. Unfortunately I only have control on one server only,
    others that can are reseller account that I dont have any access up to that level.

    I post on this topic because I also want to do the same with what MrMagoo does,
    and then I found out that I can't use the apache variable like suggested on my
    server and then I tested on my others hosting I have and found this interesting
    fact that some could and some couldn't display the variable.

    Then I post this just hoping that someone will enlighten me since my vps porvider
    support, don't have any ideas to solve this issue.

    Anyway thanks for the tips and the links.
     
  14. MrMagoo

    MrMagoo Member

    Joined:
    Sep 6, 2005
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Hey, thanks one and all. I used $_SERVER['SERVER_NAME'] and it worked first go, much appreciated. :)

    Slightly different issue, but kinda the same… I give my clients a preview URL when they first sign up e.g. http://servername/~username/index.php - unfortunately the above place holder won't display the clients domain name on the preview URL, it will only show the servers name instead.

    Has anyone found a work around for this?
     
  15. tuxdesk

    tuxdesk Well-Known Member

    Joined:
    Oct 1, 2005
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
  16. MrMagoo

    MrMagoo Member

    Joined:
    Sep 6, 2005
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Sorry, I really don't understand what you mean? :confused:
     
  17. MarcelB

    MarcelB Well-Known Member

    Joined:
    Dec 29, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    The above code is working ...... but it displays the ip-address for an new account of which the domain is not active yet.
    Is it possible to get the domain displayed for new accounts also ?
     
  18. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Try the HTTP_HOST environment variable. It displays the website that's typed in - not the default for the account.

    PHP:
    <? echo $_SERVER["HTTP_HOST"]; ?>
    Actually, re-reading I think I misunderstood your situation. This might not be what you need.
     
    #18 elleryjh, Feb 26, 2006
    Last edited: Feb 26, 2006
  19. MarcelB

    MarcelB Well-Known Member

    Joined:
    Dec 29, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    No matter what variable you use, it calls whatever is in the browser address bar.

    If I type http://ip-adddress/~username/ in the browser it will show/echo the IP-address
    If i put http://www.domain.com/~username/ in the browser it will show/echo the domain ... If the domain is active ofcourse, otherwise browser is unable to find the page.

    What I would like is to show/echo the domain even if it is not active yet, would this be possible ?
     
  20. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    No. You cannot use the domain until it is active - that's the whole point of providing the mod_userdir feature.
     
Loading...

Share This Page