Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,814 members, 7,837,928 topics. Date: Thursday, 23 May 2024 at 12:45 PM

What Could Be The Cause Of This? - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / What Could Be The Cause Of This? (724 Views)

#panamapapers – Mossack Fonseca Breach – Wordpress Possible Cause Of It / Panama Paper: Wordpress Plugin, Possible Cause Of Hack - Wordfence (2) (3) (4)

(1) (Reply) (Go Down)

What Could Be The Cause Of This? by eoatech: 8:40am On Nov 02, 2011
Hello brothers, please i need help on this issue. i keep getting this error when i upload the site on the host :

Warning: Cannot modify header information - headers already sent by (output started at /home/intlkcom/public_html/connect.php:9) in /home/intlkcom/public_html/adverifyscript.php on line 66

but the problem here is that its not giving any error if not on the host. but if i upload on the host it keep giving me the error above? please help me out. thanks!
Re: What Could Be The Cause Of This? by yawatide(f): 10:16am On Nov 02, 2011
and what code is on lines 60 to 66?
Re: What Could Be The Cause Of This? by Slyr0x: 10:33am On Nov 02, 2011
Headers should be parsed before any HTML and judging from experience certain hosts don't like you placing any HTML above the header tags.

Try doing this

Place this at the top of your page:

<? ob_start(); ?>

and then place this at the bottom of the page

<? ob_flush(); ?>

It should do the trick. . wink . .and if it doesn't work, let's see your code.
Re: What Could Be The Cause Of This? by eoatech: 12:55pm On Nov 02, 2011
thanks bro. is it before <?php
Re: What Could Be The Cause Of This? by Ymodulus: 12:59pm On Nov 02, 2011
Or you can do this
ob_start(); at the top

all the html php comes in here as content
at bottom put this code below
$content=ob_get_clean()
ob_clean();
echo $content;
Re: What Could Be The Cause Of This? by eoatech: 1:04pm On Nov 02, 2011
i didnt get it right. maybe i should paste the code here. what do you think?
Re: What Could Be The Cause Of This? by yawatide(f): 1:27pm On Nov 02, 2011
u think?
Re: What Could Be The Cause Of This? by eoatech: 1:56pm On Nov 02, 2011
its not complaining on the initial page again but now giving error on the redirected page and i try to apply the same method on it but giving me error:


Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/intlkcom/public_html/member.php:4) in /home/intlkcom/public_html/member.php on line 16
Re: What Could Be The Cause Of This? by eoatech: 2:18pm On Nov 02, 2011
Here is the page am having problem with now :


<?php

/* program name :New_member.php
descri :Displays the new Member welcome page. Greet member
by name and gives user choice to enter restricted
section or go back to main page.
written by :Mr John.
created :16/03/2011.
modified :??.
*/
// define session
ob_start;
session_start();
if (@$_SESSION['login']!="yes"wink
{
header("location:index.php"wink;
exit();
}

// connecting to the server
require_once("connect.php"wink;
ob_flush();
//selects firstname and lastname from Member
$query ="select holder,menu,no,balance from admintable
where userid = '{$_SESSION['userid']}'";
$result =mysql_query($query) or die (mysql_error());
while($row =mysql_fetch_array($result,MYSQL_ASSOC)){
extract($row);
/*echo "<html>
<head>
<title>New member Welcome page </title></head>
<body>
<h2 align='center' style='margin-top:.7in'>
Welcome $holder $menu $no $balance</h2>\n";
*/

require_once("actpage.php"wink;
}
?>
Re: What Could Be The Cause Of This? by yawatide(f): 4:52pm On Nov 02, 2011
Try removing the comments up top. If that doesn't work, I recall slyrox specifically saying you should add ob_flush() AT THE BOTTOM OF YOUR FILE, and not directly below require_once(connect.php)
Re: What Could Be The Cause Of This? by eoatech: 5:34pm On Nov 02, 2011
now i did it. and still give me the error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/intlkcom/public_html/member.php:2) in /home/intlkcom/public_html/member.php on line 6

below is what i input



<?php
// define session
ob_start;
session_start();
if (@$_SESSION['login']!="yes"wink
{
header("location:index.php"wink;
exit();
}

// connecting to the server
require_once("connect.php"wink;
//selects firstname and lastname from Member
$query ="select holder,menu,no,balance from admintable
where userid = '{$_SESSION['userid']}'";
$result =mysql_query($query) or die (mysql_error());
while($row =mysql_fetch_array($result,MYSQL_ASSOC)){
extract($row);
/*echo "<html>
<head>
<title>New member Welcome page </title></head>
<body>
<h2 align='center' style='margin-top:.7in'>
Welcome $holder $menu $no $balance</h2>\n";
*/

require_once("actpage.php"wink;
}
ob_flush();
?>
Re: What Could Be The Cause Of This? by yawatide(f): 6:37pm On Nov 02, 2011
Where are your TITLE, HEAD and META tags, might I ask, in relation to the code above? If it occurs before what you just pasted, then you can't do that. All your HTML needs to be below the session_start() and location() code.
Re: What Could Be The Cause Of This? by Nobody: 6:40pm On Nov 02, 2011
it might be that there's a whitespace u might not notice unless u use a simple notepad, use to have that issue also
Re: What Could Be The Cause Of This? by eoatech: 10:45pm On Nov 02, 2011
can you please just copy the code and put it the way i should do it. so i can see the example and follow it. thanks

(1) (Reply)

Domain Name Renewal Hike / Get Approved For Google Adsense In 24 Hours / Google Adsense

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 19
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.