Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Nov 2005
    Posts
    30

    Default Cpanel / Webmail within a Frame

    Hello,

    Just a quick question.

    Is it possible to have no header , and then have cpanel / webmail appear within a frame within an existing site, so that it keeps the same look and feel as the site?

    If this is possible, were abouts in my form/code below do you tell the code to open up the page with the 'target frame'?

    Thanks for any help.

    Kind regards,
    Anthony

    <?php
    $postlocation = "http://www.domain.com.au/docpanellogin.php";
    print "<form action=\"" . $postlocation . "\" method=\"POST\">";

    if (($_GET['failed'] == "1") or ($error == 1))
    {
    ?>
    <div align="center"><font color=#FF0000 face=verdana size=1>Your
    login attempt failed!</font><br />
    <?php
    }
    ?>
    <input name="domain" class="input2" type="text" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <br />
    <input name="username" class="input2" type="text" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <br />
    <input name="pass" class="input2" type="password" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <?php
    print "<input type=hidden name=failurl value=\"http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1\">";
    ?>
    <br />
    <select name="login_option" style="font-family: Verdana; font-size: 8pt;width:100;height:18">
    <option value="2082">cPanel </option>
    <option value="2083">Secure cPanel </option>
    </select>
    <br />
    <input name="submit" type="submit" class="input2" style="width:100;height:20;font-family:Verdana; font-size:8pt" onMouseOut="blur(this);" value=" Click to Login " />
    </form>

  2. #2
    Member
    Join Date
    Nov 2005
    Posts
    30

    Default

    Hello,

    I forgot to post the contents of docpanellogin.php - don't know if this is revelent or not.

    Kind regards,
    Anthony

    <?php

    error_reporting(E_ALL ^ E_NOTICE);
    //Here we check if any field was missed / left empty and act accordingly
    if ($_POST['domain'] && $_POST['username'] && $_POST['pass'] && !($_GET['failed'] == "1"))
    {
    switch ($_POST['login_option'])
    {
    case "2082": $port = "2082";
    $protocol = "http://";
    break;
    case "2083": $port = "2083";
    $protocol = "https://";
    break;
    case "2086": $port = "2086";
    $protocol = "http://";
    break;
    case "2087": $port = "2087";
    $protocol = "https://";
    break;
    case "2095": $port = "2095";
    $protocol = "http://";
    break;
    case "2096": $port = "2096";
    $protocol = "https://";
    break;
    }

    $redirectlocation = $protocol.$_POST['domain'].":".$port."/login/?user=".$_POST['username']."&pass=".$_POST['pass']."&failurl=".$_POST['failurl'];
    header ("Location: ".$redirectlocation);
    }
    else
    {
    $error = 1;
    header ("Location: ".$_POST['failurl']);
    }
    ?>

  3. #3
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,711
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    If you have reseller access or greater to the server, you can use the Branding Editor in cPanel to have your cPanel and Webmail interfaces match the look and feel of your website. Let me know if you need assistance with this.

  4. #4
    Member
    Join Date
    Nov 2005
    Posts
    30

    Default

    Hello David,

    Thanks for the reply.

    I have reseller access, and have been customising cpanel through branding.

    However I was referring to what in that code above can I modify so that cpanel/webmail opens up in a frame on my site.

    Kind regards,
    Anthony

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,711
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by xman888 View Post
    Hello,

    Just a quick question.

    Is it possible to have no header , and then have cpanel / webmail appear within a frame within an existing site, so that it keeps the same look and feel as the site?

    If this is possible, were abouts in my form/code below do you tell the code to open up the page with the 'target frame'?

    Thanks for any help.

    Kind regards,
    Anthony

    <?php
    $postlocation = "http://www.domain.com.au/docpanellogin.php";
    print "<form action=\"" . $postlocation . "\" method=\"POST\">";

    if (($_GET['failed'] == "1") or ($error == 1))
    {
    ?>
    <div align="center"><font color=#FF0000 face=verdana size=1>Your
    login attempt failed!</font><br />
    <?php
    }
    ?>
    <input name="domain" class="input2" type="text" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <br />
    <input name="username" class="input2" type="text" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <br />
    <input name="pass" class="input2" type="password" value="" style="width:140;height:18;font-family:Verdana; font-size:8pt" size="20" />
    <?php
    print "<input type=hidden name=failurl value=\"http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1\">";
    ?>
    <br />
    <select name="login_option" style="font-family: Verdana; font-size: 8pt;width:100;height:18">
    <option value="2082">cPanel </option>
    <option value="2083">Secure cPanel </option>
    </select>
    <br />
    <input name="submit" type="submit" class="input2" style="width:100;height:20;font-family:Verdana; font-size:8pt" onMouseOut="blur(this);" value=" Click to Login " />
    </form>
    What you could do is have your login page post to a script that generates a page with frames, and with the frame that should login to cPanel being automatically logged in using something like logmein.pm mentioned at:

    http://forums.cpanel.net/437949-post5.html

Similar Threads & Tags
Similar threads

  1. Permanent Frame
    By Masterwork in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 12-24-2007, 01:03 PM
  2. time frame between edge updates
    By dave9000 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-26-2006, 05:42 PM
  3. problem with login to cpanel from a frame
    By gilamor in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-27-2005, 04:39 AM
  4. Frame Foward
    By Zeechi in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 10-09-2003, 02:48 PM
  5. slow frame in html
    By gidechoi in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-06-2002, 07:02 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube