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.

Newbie to hooks and stuff

Discussion in 'cPanel Developers' started by flipflopmedia, Dec 13, 2009.

  1. flipflopmedia

    flipflopmedia Registered

    Joined:
    Dec 13, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I am a front end designer and do not understand this stuff in depth.

    I'm basically just wanting to customize a default index placeholder page that will be placed in the skel directory for accounts created.

    The only thing I want automatically added to this default page is the domain name associated with it.

    For Ex. The default page would read something like:
    This is the new home of www.XXX.com.

    Where XXX would be dynamically written to reflect the domain just set up. If any of that makes sense.

    If I have a custom index page in the skel directory, I don't want to have to go in and edit the code to reflect the new domain name each time an account is set up, that's the whole point of having things automated, so is this possible and is it a hook thing-a-ma-jig that I need?? ;)

    Thanks,
    Tracy
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Rename your index to index.shtml and add this where ever you like:

    Code:
    <!--#echo var="HTTP_HOST" -->
    In your cPanel under the Error Pages section, when you go to edit a file there you are presented with several buttons for a variety of tags you can use for exactly what you're seeking. :)

    HTH
     
  3. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    I already sent you this by email, but thought I'd post here in case someone else looks for it. :)

    2 other options:

    use index.php and add
    Code:
    <?=strtolower($_SERVER['HTTP_HOST'])?>
    anywhere you want the domain to show

    or

    use javascript and add
    Code:
    <script type="text/javascript">
    <!-- Begin
    document.write(window.location.hostname);
    // End -->
    </script>
    anywhere in the body, and/or
    Code:
    <script type="text/javascript">
    document.title = window.location.hostname;
    </script>
    between the head tags.
     
Loading...

Share This Page