I have 3 type of forms on my web site and all worked fine until one day. I don't know what happened but I'm getting session errors; by this I mean I get an error whenever I have a PHP script that include the session tag inside it for example this is on my start over the <html>
tag:
<?php
// Make the page validate
ini_set('session.use_trans_sid', '0');
// Create a random string, leaving out 'o' to avoid confusion with '0'
$char = strtoupper(substr(str_shuffle('abcdefghjkmnpqrstuvwxyz'), 0, 4));
// Concatenate the random string onto the random numbers
// The font 'Anorexia' doesn't have a character for '8', so the numbers will only go up to 7
// '0' is left out to avoid confusion with 'O'
$str = rand(1, 7) . rand(1, 7) . $char;
// Begin the session
session_start();
// Set the session contents
$_SESSION['captcha_id'] = $str;
?>
When I test this on my website I get:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home4/domain/public_html/adres/contact.php:2) in /home4/domain/public_html/adres/contact.php on line 16
Exactly the part where the session_start()
is ? The same code structure worked before - what happened?