Return to Snippet

Revision: 19444
at October 23, 2009 17:16 by jcroom


Initial Code
<?php
echo      '<form name="site" action="" method="post">';
echo      '<input name="next" type="hidden" value="tech">';
echo      '<select name="loc" onChange="document.site.submit()">';
if($_POST['loc'] > '')
{
echo      '<option value='.$_POST['loc'].'>'.$_POST['loc'].'</option>';
}
echo      '<option value="Billing">Billing</option>';
echo      '<option value="TCAdmin">TCAdmin</option>';
echo      '<option value="Cpanel">Cpanel</option>';
echo      '</select>';
echo      '</form>';

$site = $_POST['loc'];
if($site == '' || $site == 'Billing')// check to see if WHMCS is chosen, this is also the default option
{
echo      '<form name="whmcs" action="http://www.spugamingsolutions.com/clients/dologin.php?goto=clientarea" method="post">';
echo      'Username: <input type="text" name="username">';
echo      'Password: <input type="password" name="password">';
echo      '<input type="submit" value="Login">';
echo      '</form>';
}
elseif($site == 'TCAdmin')// check to see if tcadmin is picked
{//begin tcadmin form
echo      '<form name="tcadmin" action="http://94.76.255.115/Templates/Default/login.aspx" method="post">';
echo      'Username: <input type="text" name="USERID">';
echo      'Password: <input type="password" name="PASSWORD">';
echo      '<input type="submit" value="Login">';
echo      '</form>';
}// end tcadmin form
elseif($site == 'Cpanel')// check to see if cpanel is picked
{//begin cpanel form
echo      '<form name="cpanel" action="cpanel address" method="post">';
echo      'Username: <input type="text" name="username">';
echo      'Password: <input type="password" name="pass">';
echo      '<input type="submit" value="Login">';
echo      '</form>';
}//end cpanel form

?>

Initial URL


Initial Description
This script will allow you to choose which site you want to login to (Choose from WHMCS, TCAdmin, Cpanel) You need to edit the action= in each form to the correct address of your website.

Initial Title
mutlisite login

Initial Tags
login, javascript, php

Initial Language
PHP