Location: PHPKode > projects > Open Biller > ob/admin/add_servers.php
<?php
/**
* Creator: Michael Bacon
* Copyright 2008 - 2009 Open Biller Project. All Rights Reserved.
* This project is open source and the copyright shall not be removed from the visible pages.
*/
include('../config.php');
include('../global.php');
//checks cookies to make sure they are logged in
if(isset($_COOKIE['admin_ID_my_site']))
{
$adminame = $_COOKIE['admin_ID_my_site'];
$adminpass = $_COOKIE['admin_Key_my_site'];
$check = mysql_query("SELECT * FROM admins WHERE adminame = '$adminame'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
$query = sprintf("SELECT * FROM admins where adminame='%s' and adminpassword='%s'", 
                  mysql_real_escape_string($adminame), 
                  mysql_real_escape_string($adminpassword));
mysql_query($query);
{

//if the cookie has the wrong password, they are taken to the login page
if ($padminass != $info['adminpassword'])
{ header("Location: ../admin.php");
}
//otherwise they are shown the admin area
else
{
?>
<?php
$username = $_COOKIE['admin_ID_my_site'];
$query = mysql_query("SELECT * FROM admins WHERE adminame = '$adminame'")or die(mysql_error());
while($row = mysql_fetch_array($query)) {
?>
<html>
<head>
<title><?php echo $script_title; ?> Project</title>
</head>
<body link="blue" alink="blue" vlink="blue">
<table>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<strong><font color="red" size="1">* means Required Field</font></strong>
<tr><td><strong><font color="red" size="1">*</font></strong>Server Type:</td><td>
<select name="servertype">
  <option value="cpanel">cPanel</option>
</select></td></tr>
<tr><td><strong><font color="red" size="1">*</font></strong>WHM Access Key:</td><td>
<textarea rows="5" cols="80" name="key">
</textarea>
</td></tr>
<tr><td><strong><font color="red" size="1">*</font></strong>Server IP Address:</td><td>
<input type="text" name="ip" maxlength="60">
</td></tr>
<tr><td><strong><font color="red" size="1">*</font></strong>Server Username(Example: Root)</td><td>
<input type="text" name="serveruser" maxlength="60">
</td></tr>
<tr><th colspan=2><input type="submit" name="submit" value="Add Server"></th></tr> </table>
</form>
<?php } ?>
<!-- Please Support Our Project! Do not remove the copyright under any circumstances! -->
<?php echo copyright_text();?>
</body>
</html>
<?php
}
}
}
else
//if the cookie does not exist, they are taken to the login screen
{
header("Location: ../admin.php");
}
?>
Return current item: Open Biller