• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

BUG session_start(): Cannot start session when headers already sent

sebastian

New member
Messages
2
Likes
0
Points
1
#1
I use your plug in for years now working fine. Until a few weeks.

I use the following code on my page, which was working fine for years:

[insert_php]
session_start();
$_SESSION["selectedtariff"] = $_POST["selectedtariff"];
[/insert_php]


Now I get the following error message:
Warning: session_start(): Cannot start session when headers already sent in /homepages/XXX/wp-content/plugins/xinsert-php/includes/shortcodes/shortcode-php.php(52) : eval()'d code on line 1

Old [insert_php] is activated in the settings.
If I create a global php-snippet with this code it works, but then my code on the following webpage
[insert_php]
include "tarc/confirm.php";
[/insert_php]


is not working.

Do you have a solution or any ideas how to solve this problem?
Thank you in advance for your help!
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

This error means that some kind of output to the browser has been carried out recently before you create a session. Judging by the error, one of your PHP snippets outputs something when the page loads.
It may even be an empty line at the beginning of your snippet code
 

sebastian

New member
Messages
2
Likes
0
Points
1
#3
Hi Temyk!

Thank you for your fast reply.
Is there a possibility to get support on my webpage?
As my php skills are limited, I need a professional ;-)

Sebastian
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#4
We provide support only for the work of the plugin.
We do not support your code.