Jump to content

Recommended Posts

Posted

I think it is related to both

header("Location: $referer"); 

and

ob_start and ob_end_clean()

so no output was being generated.

Posted

Ok, as your suggestion, I've removed the

ob_start();

from "header.php" and my "index.php" and others are now executing. But now I'm getting some errors.

In "index.php" I'm getting the following errors:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/sgs/public_html/sgpaste/index.php:12) in /home/sgs/public_html/sgpaste/global/header.php on line 3

and the error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sgs/public_html/

sgpaste/index.php:12) in /home/sgs/public_html/sgpaste/global/header.php on line 3

and I know that, if I remove the "session_start()" function then the problem will be omitted. But I don't want to do that because, if I do that then my project will not work. Or if I add the "ob_start()" function then the previous problem(blank display) will happen. So what to do?

 

And in "login.php" I'm getting the following error after removing the "ob_start()" function:

Warning: Cannot modify header information - headers already sent by (output started at /home/sgs/public_html/sgpaste/global/header.php:27) in /home/sgs/public_html/sgpaste/config/functions.php on line 255

These errors happens where I'm using "$_SESSION/$_COOKIE/header()" please solve my problem...

Here is my "functions.php" file:

Source file of "functions.php": http://www.sgpaste.tk/src/functions.php

Source file of "login.php": http://www.sgpaste.tk/src/login.php

Executable file of "login.php": http://www.sgpaste.tk/login.php

Posted

In login.php remove the check_cookie() function as you are not using the output (BOOL) to check whether cookies are working or not.

 

The problem is just that your output has started and you need to execute the function

session_start

and the

setcookie() function

before the output starts. ( Include those statements before any echo statement or before outputting any data to the user. )

  • Like 1
Posted

I can just help you with the basics and help you understand the problem in your code. The editing of the code and fixing the bugs needs to be done by you. :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...