soheil_v
Member
سلام دوستان عزيز من يك راهنمايي مي خواستم و اون اينه كه
ما دو تا كد داريم كه فكر كنم ايراد داره كه اين پيغام را ميده
Warning: Cannot modify header information - headers already sent by (output started at /home2/khosrow/public_html/header.php:67) in /home2/ueser/public_html/control.php on line 107
اين كد header
اين كد control هم كه براي اجرا شدنش بايد كد بالايي سالم باشه ولي باز هم اين كد هم در خط 107 - 112-113-114-115 ايراد داره
اگه شما عزيزان لطف كنيد به من كمك كنيد ممنونتون ميشم
باتشكر
ما دو تا كد داريم كه فكر كنم ايراد داره كه اين پيغام را ميده
Warning: Cannot modify header information - headers already sent by (output started at /home2/khosrow/public_html/header.php:67) in /home2/ueser/public_html/control.php on line 107
اين كد header
کد:
<?php
session_start();
include("includes/functions.php");
include("includes/pathes.php");
include("config.php");
mysql_connect($host, $dbuser, $dbpass);
mysql_select_db($database_name);
include("includes/counter.php");
global $ln;
if (!$ln){
$l_s = $_POST['langsite'];
if ($l_s){$lng = $_POST['langsite'];
$_SESSION['lng'] = $lng;
}
if ($lng == null){$l=$language;} else {$l=$lng;}
if ($l_s){
setcookie("lng", $l_s, time()+(3600*24)*30);
}
}
else
{
if (file_exists("language/$ln")) {$l=$ln;}
}
include("database/sql.php");
create_refer_tb();
create_hint_tb();
$http_referrer = getenv( "HTTP_REFERER" );
$refer_date = date("U");
$ip = $_SERVER['REMOTE_ADDR'];
// Save refer link ------------
$id_ref = 0;
$result_http_ref = mysql_query("SELECT id FROM ".$tb_prefix."referlinks");
while($rlinksrow = mysql_fetch_array($result_http_ref)){
if ($rlinksrow['id'] > $id_ref){$id_ref = $rlinksrow['id'];}
}
$id_ref++;
// ------------ Save refer link
if ($http_referrer){mysql_query("INSERT INTO ".$tb_prefix."referlinks (id, date, url, ip) VALUES ('".$id_ref."', '".$refer_date."', '".$http_referrer."', '".$ip."')");}
mysql_close();
global $act, $func;
if (strtolower($section) == 'contents' and strtolower($act) == 'vcont'){
}
else
{
echo '<div align="center"><table dir="ltr" width="734" border="0" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td width="184" valign="top" background="'.$site_url.'/styles/'.$style_name.'/images/'.$l.'/top-menu.gif"><div align="left" style="padding-top:16px; padding-left:16px">
<table width="60" border="0" cellspacing="0" cellpadding="0" id="table2">
<tr>
<td width="60"><div align="center">
<div align="left"><span>
<img src="'.$site_url.'/styles/'.$style_name.'/images/'.$l.'/home.gif" width="13" height="13" align="absmiddle"> </span>
<a href="'.$site_url.'/index.php"><font color="#999999">Home...!</font></a></div>
</div></td>
</tr>
</table>
</div></td>
<td width="5"> </td>
<td width="547"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="547" height="175">
<param name="movie" value="'.$site_url.'/styles/'.$style_name.'/header.swf">
<param name="quality" value="high">
<param name="Menu" value="false">
<embed src="'.$site_url.'/styles/'.$style_name.'/header.swf" width="547" height="175" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed>
</object></td>
</tr>
</table></div>';
}
ob_start();
?>
اين كد control هم كه براي اجرا شدنش بايد كد بالايي سالم باشه ولي باز هم اين كد هم در خط 107 - 112-113-114-115 ايراد داره
کد:
<?php
// Check directed...
if ($no_directed == false){
echo 'No access directly!';
exit;
}
// Check diected...
# Set language
global $l;
if ($l == null or !file_exists("language/$l")){
$set_lang = false;
$l = $language;}
else
{
$set_lang = true;
}
#-------------------
# Import language file
require_once("language/$l/admin/admin.php");
#------ END LANG -------------------------
# Includes ------------------------------
include ("includes/admin_functions.php");
# ---------------------------------------
if (file_exists("../config.php")){
include("../config.php");}
else
{
include("config.php");}
mysql_connect($host, $dbuser, $dbpass);
mysql_select_db($database_name);
global $admin_section, $mode;
if ($mode == 'newadmin'){
$id = 0;
$result = mysql_query("SELECT * FROM ".$tb_prefix."admins");
$num_admins = mysql_num_rows($result);
while($adminsrow = mysql_fetch_array($result)){
if ($adminsrow['id'] > $id){$id = $adminsrow['id'];}
}
$id++;
$uadmin = $_POST['guadmin'];
$realname = $_POST['grealname'];
$password = md5($_POST['gpass']);
$user_fid = $_POST['gfid'];
if ($num_admins == 0){
mysql_query("INSERT INTO ".$tb_prefix."admins (id, user, password, realname, u_fid, access, god) VALUES ('".$id."', '".$uadmin."', '".$password."', '".$realname."', '".$user_fid."', 'full', '1')");}
$location = 'index.php?section=control';
if ($l != $language) {$location = $location."&l=$l";}
header("Location: $location");
}
$admin_section = strtolower($admin_section);
$is_control_panel = true;
switch($direction){
case 'rtl':
$direc_set = 'right';
break;
case 'ltr':
$direc_set = 'left';
break;
}
create_admin_tb();
$result = mysql_query("SELECT * FROM ".$tb_prefix."admins");
$num_admins = mysql_num_rows($result);
if ($num_admins == 0)
{
$h_size = strlen($lang_admin['control_panel']) *4;
$action_form = "?section=control&mode=newadmin";
if ($l != $language){$action_form = $action_form."&l=$l";}
echo '<table border="0" width="100%" cellpadding="0" cellspacing="5">
<tr>
<td><b><font color="'.$bordercolor2.'">'.$lang_admin['control_panel'].'</font></b><hr size="1" width="'.$h_size.'" align="'.$direc_set.'"></td>
</tr>
<tr>
<td>'.$lang_admin['register'].'</td>
</tr>
<form method="POST" action="'.$action_form.'">
<tr>
<td><hr size="1" width="100%" align="center" dir="rtl">'.$lang_admin['user'].'   <input class="post" type="text" name="guadmin" size="25"></td>
</tr>
<tr>
<td>'.$lang_admin['realname'].'   <input class="post" type="text" name="grealname" size="25"></td>
</tr>
<tr>
<td>'.$lang_admin['password'].'    <input class="post" type="password" name="gpass" size="25"></td>
</tr>
<tr>
<td>'.$lang_admin['verify_password'].'   <input class="post" type="password" name="gvpass" size="25"></td>
</tr>
<tr>
<td>'.$lang_admin['user_fid'].' <input class="post" type="text" name="gfid" size="25"><hr size="1" width="100%" align="center" dir="rtl"></td>
</tr>
<tr>
<td><input class="post" type="submit" value="'.$lang_admin['regbtn'].'" name="radmin"></td>
</tr>
</form>
</table>';
}
else
{
session_start();
if (isset($_COOKIE['admin_cookie_secure'])) {
foreach ($_COOKIE['admin_cookie_secure'] as $name => $value) {
$tmpuser[$name] = $value;
}
}
$query = mysql_query("select * from ".$tb_prefix."admins where user='".$tmpuser['admin_name']."' and password='".$tmpuser['admin_pass']."'");
if (mysql_num_rows($query) == 0){$_SESSION['admin_logged_in'] = true;
setcookie("admin_cookie_secure[admin_logged_in]", true);
} else {$_SESSION['admin_logged_in'] = true;
$_SESSION['admin_id'] = $tmpuser['admin_id'];
$_SESSION['admin_name'] = $tmpuser['admin_name'];
}
if (!$_SESSION['admin_logged_in'] and $admin_section){
$location = 'index.php?section=errors&error=403';
if ($l != $language) {$location = $location."&l=$l";}
header("Location: $location");
}
$user_admin = strtolower($_POST['uadmin']);
$password_admin = md5($_POST['padmin']);
if ($user_admin and $password_admin){
$query = "select * from ".$tb_prefix."admins where user='$user_admin' and password='$password_admin'";
$result = mysql_query($query);
if (mysql_num_rows($result) == 1){
$adminrow = mysql_fetch_array($result);
$_SESSION['admin_id'] = $adminrow['id'];
$_SESSION['admin_logged_in'] = true;
$_SESSION['admin_name'] = $user_admin;
setcookie("admin_cookie_secure[admin_id]", $adminrow['id'], time()+3600);
setcookie("admin_cookie_secure[admin_logged_in]", true, time()+3600);
setcookie("admin_cookie_secure[admin_name]", $user_admin, time()+3600);
setcookie("admin_cookie_secure[admin_pass]", $password_admin, time()+3600);
}
else
{
echo '<br><div align="center" dir="rtl">
<table border="0" width="95%" cellpadding="6" style="border: 1px dotted '.$bordercolor2.'; " bgcolor="'.$bgcolor2.'">
<tr>
<td bgcolor="'.$bgcolor2.'" valign="top" style="line-height: 200%"><div align="center" dir="rtl"><b><font color="'.$bordercolor2.'">'.$lang_admin['successadmin'].'</font></b></div>';
echo '
</td>
</tr>
</table>
</div>';
$location = 'index.php?section=control';
if ($l != $language) {$location = $location."&l=$l";}
echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; URL=$location\">";
}
}
else if ($_SESSION['admin_logged_in'] != true)
{
$h_size = strlen($lang_admin['control_panel']) *4;
$action_form = "?section=control";
if ($l != $language){$action_form = $action_form."&l=$l";}
echo '<table border="0" width="100%" cellpadding="0" cellspacing="5">
<tr>
<td><b><font color="'.$bordercolor2.'">'.$lang_admin['control_panel'].'</font></b><hr size="1" width="'.$h_size.'" align="'.$direc_set.'"></td>
</tr>
<tr>
<td>'.$lang_admin['welcome'].'</td>
</tr>
<form method="POST" action="">
<tr>
<td><hr size="1" width="100%" align="center" dir="rtl">'.$lang_admin['user'].' <input class="post" type="text" name="uadmin" size="18"></td>
</tr>
<tr>
<td><hr size="1" width="100%" align="center" dir="rtl">'.$lang_admin['password'].'   <input class="post" type="password" name="padmin" size="18"></td>
</tr>
<tr>
<td><input class="post" type="submit" value="'.$lang_admin['login'].'" name="eadmin"></td>
</tr>
</form>
</table>';
}
}
if ($admin_section == null){
if ($_SESSION['admin_logged_in']){
include("admin_items.php");
}
}
else if ($_SESSION['admin_logged_in'])
{
switch($admin_section){
case 'logout':
session_destroy();
$_SESSION['admin_logged_in'] != false;
setcookie("admin_cookie_secure[admin_id]", null);
setcookie("admin_cookie_secure[admin_logged_in]", false);
setcookie("admin_cookie_secure[admin_name]", null);
// setcookie("admin_cookie_secure[admin_pass]", null);
echo '<br><div align="center" dir="rtl">
<table border="0" width="95%" cellpadding="6" style="border: 1px dotted '.$bordercolor2.'; " bgcolor="'.$bgcolor2.'">
<tr>
<td bgcolor="'.$bgcolor2.'" valign="top" style="line-height: 200%"><div align="center" dir="rtl"><b><font color="'.$bordercolor2.'">'.$lang_admin['logged_out'].'</font></b></div>';
echo '
</td>
</tr>
</table>
</div>';
$index_p = "index.php";
if ($l != $language){$index_p = $index_p."?l=$l";}
echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; URL=$index_p\">";
break;
case 'news':
include("c-news.php");
break;
case 'contents':
include("c-contents.php");
break;
case 'refers':
include("c-refers.php");
break;
case 'upload':
include("c-upload.php");
break;
}
if ($admin_section != null and $admin_section !='logout' and !file_exists("c-$admin_section.php")){
$location = 'index.php?section=errors&error=404';
if ($l != $language) {$location = $location."&l=$l";}
header("Location: $location");
}
}
mysql_close();
?>
اگه شما عزيزان لطف كنيد به من كمك كنيد ممنونتون ميشم
باتشكر
آخرین ویرایش: