искам да питам как може да се добави нещо в този код например хеадър отгоре някакво меню или или кода да се добави към някъв друг код
Код:
<?php
if (!file_exists('database/mysql.php')) {
echo ("<script language=javascript>document.location.href = 'admin/install.php'</script>");
}
require('database/db.php');
if ($row_Config['installed'] != '1') {
echo ("<script language=javascript>document.location.href = 'admin/install.php'</script>");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ZPanel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#6E7C95">
<table width="100%" height="97%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bgcolor="#6E7C95"><table width="445" height="212" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#EDF5FE"><div align="center">
<br>
<strong><font face="Verdana, Arial, Helvetica, sans-serif" size="5"><?php echo $row_Config['company']; ?><br>
</font></strong>
<?php
if (isset($_POST['uname'])) {
$query_TempUser = sprintf("SELECT * FROM custumerbase WHERE servicename = '".Clean($_POST['uname'],1)."'");
$TempUser = mysql_query($query_TempUser, $Customer_Database);
$row_TempUser = mysql_fetch_assoc($TempUser);
$totalRows_TempUser = mysql_num_rows($TempUser);
$colname_Packages = "1";
$query_Packages = sprintf("SELECT * FROM packages WHERE package_name = '".$row_User['webservice']."'", $colname_Packages);
$Packages = mysql_query($query_Packages, $Customer_Database) or die(mysql_error());
$row_Packages = mysql_fetch_assoc($Packages);
$totalRows_Packages = mysql_num_rows($Packages);
}
if (isset($_POST['submit'])) { // if form has been submitted
/* check they filled in what they were supposed to and authenticate */
if(!$_POST['uname'] | !$_POST['passwd']) {
die('You did not fill in a required field.');
}
// authenticate.
if ($totalRows_TempUser == '0') {
die('We are unable to log you in with the information you provided. Please check your username and password and try again.');
}
// check passwords match
$_POST['passwd'] = stripslashes($_POST['passwd']);
if(md5($_POST['passwd']) == $row_TempUser['ftppass']) { // valid password for username
if (strtolower($row_TempUser['status']) == 'suspended') {
unset($_SESSION['username']);
unset($_SESSION['password']);
echo ("<script language=javascript>document.location.href = '../suspended.php'</script>");
}else{
// if we get here username and password are correct,
//register session variables
$_SESSION['username'] = strtolower(Clean($_POST['uname'],1));
$_SESSION['password'] = $_POST['passwd'];
$logged_in = 1;
$date = date('m d, Y');
$_SESSION['Rank'] = $row_TempUser['Rank'];
$_SESSION['id'] = $row_TempUser['id'];
$_SESSION['homedir'] = $row_TempUser['homedir'];
// $query = sprintf("UPDATE custumerbase SET last_ip=active_ip, last_datetime=active_datetime, active_ip='".$_SERVER['REMOTE_ADDR']."', active_datetime='".date("m/d/y h:i A")."' WHERE servicename='".Clean($_POST['uname'],1)."'");
// $result = mysql_query($query, $Customer_Database) or die(mysql_error());
echo ("<script language=javascript>document.location.href = 'zpanel.php'</script>");
}
} else {
$logged_in = 0;
unset($_SESSION['username']);
unset($_SESSION['password']);
die('We are unable to log you in with the information you provided. Please check your username and password and try again');
}
}
if (isset($_GET['passrequest'])) {
if (isset($_GET['user']) && isset($_GET['code']) && ($_GET['code'] != '')) {
mysql_select_db($database_Customer_Database, $Customer_Database);
$query_TempUser = sprintf("SELECT * FROM custumerbase WHERE servicename = '".Clean($_GET['user'],1)."'");
$TempUser = mysql_query($query_TempUser, $Customer_Database);
$row_TempUser = mysql_fetch_assoc($TempUser);
if ($_GET['code'] == $row_TempUser['resetpass']) {
$newpass = rand(10000000,88888888);
$query = sprintf("UPDATE custumerbase SET ftppass='".md5($newpass)."', resetpass='' WHERE servicename='".$row_TempUser['servicename']."'");
$Result = mysql_query($query, $Customer_Database);
die ('<b>Your Password has been reset.</b><br><br>Your new password is: '.$newpass.'<br><br>You may change this after you <a href=index.php>login</a>.');
}else{
die ('<b>Your Reset Code is Incorrect!</b>');
}
}
if (isset($_POST['email'])) {
mysql_select_db($database_Customer_Database, $Customer_Database);
$query_TempUser = sprintf("SELECT * FROM custumerbase WHERE email = '".Clean($_POST['email'])."'");
$TempUser = mysql_query($query_TempUser, $Customer_Database);
$row_TempUser = mysql_fetch_assoc($TempUser);
if ($row_TempUser['email'] != '') {
$key = md5(rand(20,100));
do {
$query = sprintf("UPDATE custumerbase SET resetpass='".$key."' WHERE servicename='".$row_TempUser['servicename']."'");
$Result = mysql_query($query, $Customer_Database);
$emailbody = "This is an automatic e-mail from your hosting company. You are receiving this e-mail because you, or someone else with your e-mail address, requested a password reminder. Below is the information requested.\n\n";
$emailbody .= "Username: ".$row_TempUser['servicename']."\n";
$emailbody .= "Reset Link: ".$row_Config['webaddy']."/index.php?passrequest&user=".$row_TempUser['servicename']."&code=".$key."\n";
$emailbody .= "Reset Code: ".$key."\n";
$emailbody .= "---------------------------------------\n\n";
$emailbody .= "Thank you for choosing ".$row_Config['company'];
//Debug this later
// if (ini_get('sendmail_from') == '') {
// ini_set('sendmail_from') = "admin@yourhost.com";
// }
//End debug
mail($_POST['email'], "Your ZPanel Password", $emailbody,
"From: ".$row_Config['support_email']."\r\n") or die ('Error');
} while ($row_TempUser = mysql_fetch_assoc($TempUser));
die ('<br>Your reset code has been sent to your e-mail. If your e-mail address you entered is incorrect, you will not receive the reset. Please check your e-mail for further instructions.<br><br>< <a href=index.php>Back</a> >');
}else{
die ('<br>Your reset code has been sent to your e-mail. If your e-mail address you entered is incorrect, you will not receive the reset. Please check your e-mail for further instructions.<br><br>< <a href=index.php>Back</a> >');
}
}
?>
<form action="index.php?passrequest" method="post" enctype="application/x-www-form-urlencoded" name="form1">
<p><strong>Password Retrieval</strong></p>
<p> E-Mail Address:
<input type="text" name="email">
<br>
<input type="submit" name="Submit" value="Go!">
</p>
</form>
<?php }else{ ?>
<br>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<table align="center" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="99" height="28" bgcolor="#CCCCCC">Demo User</td>
<td width="69"><font size="2"><?php echo $lang_username; ?></font>:</td>
<td width="149"> <input class="inputbox" type="text" name="uname" maxlength="40">
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><font size="2"><?php echo $lang_username; ?>:
demo<br>
<?php echo $lang_password; ?>: demo <br>
</font></td>
<td><font size="2"><?php echo $lang_password; ?></font>:</td>
<td> <input class="inputbox" type="password" name="passwd" maxlength="50">
</td>
</tr>
<tr>
<td colspan="3" align="right"> <input class="inputbox" type="submit" name="submit" value="Login">
</td>
</tr>
</table>
<font size="2">( <a href="?passrequest">Lost Password</a> ) </font>
</form>
<?php } ?>
</div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>