<body>
<?php
$domain = $_POST['domainname'];
?>
<form action="http://" "<?php print $domain; ?>:2083/login" method="POST">
<input type="hidden" name="login_theme" value="cpanel">
<table width="200" class="login" cellpadding="0" cellspacing="0">
<tr>
<td align="left"><b>Login</b></td>
<td> </td>
</tr>
<tr>
<td>Domain</td>
<td>
<input autocomplete="off" type="text" name="domainname" size="16">
</td>
</tr>
<tr>
<td>Username</td>
<td>
<input autocomplete="off" type="text" name="user" size="16">
</td>
</tr>
<tr class="row2">
<td>Password</td>
<td>
<input type="password" name="pass" size="16">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Login" class="input-button">
</td>
</tr>
</table>
</form>
</body>
I have this code on a basic php file. My goal is to have a centralised hub for cpanel users to login into.
They will input their domain name, username and password into the form, the form will take them to http://theirdomain.com/cpanel and log them in by passing the credentials through.
Only problem I am having is outputting the domain variable in the form's action to make it go there. Just getting 'about:blank'
EDIT: I have moved the redirect script over to a second file, and it seems to be redirecting to the domain fine now. However, now the credentials won't pass through.
</div>
Ended up with this (probably not the cleanest, but it works)
index.php
<?php
$domain = $_POST['domainname'];
?>
<form action="cplogin.php" method="post">
Domain: <input type="text" name="domainname" size="50" /><br />
Username: <input type="text" name="user" size="50" /><br />
Password: <input type="password" name="pass" size="20" autocomplete="off" /><br />
<input type="submit" class="btn btn-red" name="login" value="Login" />
</form>
and cplogin.php
<?php
$domain = $_POST['domainname'];
if(!$_POST['login']) {
exit;
}
$user = $_POST['user'];
$pass = $_POST['pass'];
$port = "2083";
$port == "2083" || $port == "2083" ? $pre = "https://" : $pre = "https://";
?>
<body onLoad="setTimeout('document.forms[0].submit();',10)">
<form action="<?php echo "".$pre."".$domain.":".$port."/login/"; ?>" method="post">
<input type="hidden" name="user" value="<?php echo $user; ?>">
<input type="hidden" name="pass" value="<?php echo $pass; ?>">
</form>
<form action="http://<?php echo $domain; ?>:2083/login" method="POST">
<!--form content-->
</form>