Jump to content

Recommended Posts

Hi all,

Yea i did read sticky, and i also searched forums..

I'm not an advanced programmer, and im writing a basic memberhip system for my site, so i got the following:

<html>
<head>
<title>..~ Welcome to Business-Name! - Subpage #1 ~..</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body background="images/bg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table align="center" width="729" height="740" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="2" width="729" height="66">
<img src="images/spacer.gif" align="absmiddle" width="40" height="1"><img src="images/logo_icon.gif" align="absmiddle"><font class="logo1">  Business-Name</font>			</td>
</tr>
<tr>
	<td colspan="2" background="images/navigation.gif" width="729" height="45" class="navigation">
<Center><a href="/">Website Home</a><img src="images/nav_spacer.gif" align="absmiddle" vspace="0" hspace="2"><a href="/">Company 
Information</a><img src="images/nav_spacer.gif" align="absmiddle" vspace="0" hspace="2"><a href="/">Service 
List</a><img src="images/nav_spacer.gif" align="absmiddle" vspace="0" hspace="2"><a href="/">Our 
Clients</a><img src="images/nav_spacer.gif" align="absmiddle" vspace="0" hspace="2"><a href="/">Get 
Support</a><img src="images/nav_spacer.gif" align="absmiddle" vspace="0" hspace="2"><a href="/">Contact 
Details</a></Center>			</td>
</tr>
<tr>
	<td rowspan="2" background="images/header.gif" width="424" height="191">
		</td>
	<td background="images/client_login.gif" width="305" height="47">
<img src="images/spacer.gif" width="1" height="9"><br>
<img src="images/spacer.gif" align="absmiddle" width="19" height="1"><font class="headings">Subpage 
Navigation</font><img src="images/arrow.gif" align="absmiddle" vspace="0" hspace="6"></td>
</tr>
<tr>
	<td background="images/login_bg.gif" width="305" height="144">
<div class="main"></div></td>
</tr>
<tr>
	<td background="images/welcome.gif" width="424" height="42">
<img src="images/spacer.gif" width="1" height="4"><br>
<img src="images/spacer.gif" align="absmiddle" width="19" height="1"><font class="headings">Welcome to 
the subpage!</font><img src="images/arrow.gif" align="absmiddle" vspace="0" hspace="6"></td>
	<td rowspan="2" background="images/subpage_2.gif" width="305" height="393">
<div class="main"><br>
 <a href="/"></a></div>			</td>
</tr>
<tr>
	<td background="images/subpage_1.gif" width="424" height="351">
<div class="welcome"><font color="#92a2b9">
<?php 
ob_start();
include 'auditclient/client_area.php';
ob_end_clean();
?>
<br>
</font><br>
<br>
<br>
 </div></td>
</tr>
<tr>
	<td colspan="2" background="images/navigation.gif" width="729" height="45" class="navigation">
<center><a href="/">Website Home</a><img src="images/footer_spacer.gif" align="absmiddle"><a href="/">Company 
Information</a><img src="images/footer_spacer.gif" align="absmiddle"><a href="/">Service 
List</a><img src="images/footer_spacer.gif" align="absmiddle"><a href="/">Our 
Clients</a><img src="images/footer_spacer.gif" align="absmiddle"><a href="/">Get 
Support</a><img src="images/footer_spacer.gif" align="absmiddle"><a href="/">Contact 
Details</a></center>			</td>
</tr>
</table>
<br>
</body>
</html>

My only php in this "html page" is:

<?php 
ob_start();
include 'auditclient/client_area.php';
ob_end_clean();
?>
[code]
And this returned in this ugly error 
As i see, i dont have any white space?

Link to comment
https://forums.phpfreaks.com/topic/149844-unable-to-modify-header/
Share on other sites

My guess is that the included file is trying to write a header, but can't due to the Headers already sent.

Post the contents of the included file, please.

 

<?PHP
include "phpaudit_configuration.php";
include "inc/globals.php";
include "language/".$config['language'].".php";
include "inc/general_functions.php";
include "inc/login_functions.php";
include "inc/display_functions.php";
include "inc/client_area_functions.php";
include "inc/billing_functions.php";

#-------------------------------------------------------------------------------------------------------------

clear_cache();
$client_id=process_session($config);
if (isset_reset_password($client_id)==1) 
{ 
$client_in_process=true;
header("Location: ".$config['http_web']."/client_in_process.php");
exit;
}

#-------------------------------------------------------------------------------------------------------------

include $config['server_tpl']."/header.php";
include $config['server_tpl']."/client_area.php";
include $config['server_tpl']."/footer.php";
mysql_close($dblink);
?>

 

cient_in_process.php :

 

 

<br />
<form action='<?PHP echo $_SERVER['PHP_SELF']; ?>' method='POST' class='no_padding'>
<table width='400' cellpadding='2' cellspacing='0' border='0' align='center'>
	<tr>
		<td colspan='2' class='padding_100'><span class='text_bold'><?PHP echo $w['client_in_process']['please_change_password']; ?></span></td>
	</tr>
	<tr>
		<td colspan='2' class='padding_100'><img src='<?PHP echo $config['http_tpl_image']; ?>/default[-2].gif' width='100%' height='5'></td>
	</tr>

<?PHP
if ($error) 
{
?>

	<tr>
		<td colspan='2'><div class='wrapper'><?PHP echo $error; ?></span></div><br /></td>
	</tr>

<?PHP }?>

	<tr>
		<td align='left' valign='middle' class='padding_40'><span class='text'><?PHP echo $w['client_in_process']['new_password']; ?></span></td>
		<td align='left' valign='middle' class='padding_60'><input class='required' type='password' name='password' value='<?PHP echo $_POST['password']; ?>'></td>
	</tr>
	<tr>
		<td align='left' valign='middle' class='padding_40'><span class='text'><?PHP echo $w['client_in_process']['verify_password']; ?></span></td>
		<td align='left' valign='middle' class='padding_60'><input class='required' type='password' name='verify_password' value='<?PHP echo $_POST['verify_password']; ?>'></td>
	</tr>
	<tr>
		<td colspan='2' align='left' valign='middle'><img src='<?PHP echo $config['http_tpl_image']; ?>/phpaudit[-1].gif' width='1' height='4'></td>
	</tr>
	<tr>
		<td align='left' valign='middle' class='padding_40'></td>
		<td align='left' valign='middle' class='padding_60'><input class='submit' type='submit' name='change_password' value='<?PHP echo $w['client_in_process']['save_changes']; ?>'></td>
	</tr>
</table>
</form>

 

<?php
ob_start(); # Added
include "phpaudit_configuration.php";
include "inc/globals.php";
include "language/".$config['language'].".php";
include "inc/general_functions.php";
include "inc/login_functions.php";
include "inc/display_functions.php";
include "inc/client_area_functions.php";
include "inc/billing_functions.php";

#-------------------------------------------------------------------------------------------------------------

clear_cache();
$client_id=process_session($config);
if (isset_reset_password($client_id)==1) 
{ 
$client_in_process=true;
header("Location: ".$config['http_web']."/client_in_process.php");
exit;
}

#-------------------------------------------------------------------------------------------------------------

include $config['server_tpl']."/header.php";
include $config['server_tpl']."/client_area.php";
include $config['server_tpl']."/footer.php";
mysql_close($dblink);
ob_flush();        # Added
?>

ALL the lines of html before the <?php tag in the first piece of posted code IS CONTENT that is being output to the browser and will prevent any headers from working.

like PFMaBiSmAd and others have been saying put this code before ANY other output INCLUDING HTML!!!!!

 

ob_start();

 

so the start of that html file should look like this

<?php
ob_start();
?>
<html>
<head>
<title>..~ 

 

and the end should look something like this

</body>
</html>
<?php
ob_end_flush();
?>

 

 

make sure u dont have ANY php echoing or ANY HTML code before ob_start(); or after ob_end_flush(); commands.

ALL the lines of html before the <?php tag in the first piece of posted code IS CONTENT that is being output to the browser and will prevent any headers from working.

like PFMaBiSmAd and others have been saying put this code before ANY other output INCLUDING HTML!!!!!

 

ob_start();

 

so the start of that html file should look like this

<?php
ob_start();
?>
<html>
<head>
<title>..~ 

 

and the end should look something like this

</body>
</html>
<?php
ob_end_flush();
?>

 

 

make sure u dont have ANY php echoing or ANY HTML code before ob_start(); or after ob_end_flush(); commands.

Yea i tried that, but then IE tells me the webpage cannot be displayed... so i though i really messedup doing that.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.