Jump to content

Connecting to Cpanel


Vivid Lust

Recommended Posts

Hi, im trying to make a script where a client can connect to their cpanel externally.

 

This is my script so far:

 

Client Login: 
<form action="client.php" method="post">
Domain <br />
<input type="text" name="domain" /> <br />
Username<br />
<input type="text" name="user" /> <br />
Password<br />
<input type="password" name="pass" /> <br />
<input type="submit" value="login" />
</form>

 

<?php
$domain = $_POST['domain'];

header("location: http://".$domain.":2083/login/");

?>

 

It isn't working, any help???

 

Thanks in advanced.

Link to comment
https://forums.phpfreaks.com/topic/117696-connecting-to-cpanel/
Share on other sites

lets see client.php

 

 

heres what I made awhile back

 

<?php
// make sure all needed information is provided
if($_POST['username'] && $_POST['pass'] && !($_GET['failed'] == "1")) {
    $port = $_POST['port']; // sets the port number to login to
    // Get the protocol to use for this connection
    switch($port) {
      case '2082': // cPanel
      case '2086': // WHM
      case '2095': // Webmail
        $protocol = 'http://';
        break;
      case '2083': // Secure cPanel
      case '2087': // Secure WHM
      case '2096': // Secure Webmail
        $protocol = 'https://';
        break;
    }
  // Build the URL
  $redirectlocation = $protocol.'websites4clans.com'.':'.$port.'/login/?user='.$_POST['username'].'&pass='.$_POST['pass'].'&failurl='.$_POST['failurl'];
  header ("Location: ".$redirectlocation); // Send URL
} else {
  $error = 1;
  header ("Location: ".$_POST['failurl']); // Send URL if all neede information is not provided
}
?>

 

<form action="cpanelLogin.php" method="POST">
          <div align="justify">
            <?php
// Show an error if the login failed
if(($_GET['failed'] == "1") or ($error == 1)){
echo '<font color="#FF0000">Your login attempt failed!</font><br />';
}
?>
            Username: 
  <input type="text" name="username" value="" size="20" />
  <br />
            Password: 
  <input type="password" name="pass" value="" size="20" />
  <br />
  <?php
// This failurl allows cPanel to redirect back to this site
echo '<input type="hidden" name="failurl" value="http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?failed=1">';
?>
            Options: 
  <select name="port">
    <option value="2082">cPanel </option>
    <option value="2083">Secure cPanel </option>
    <option value="2095">Webmail</option>
    <option value="2096">Secure Webmail</option>
  </select>
  <br />
  <input type="submit" value="Login" />
          </div>
	</form></td>

Link to comment
https://forums.phpfreaks.com/topic/117696-connecting-to-cpanel/#findComment-605373
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.