Warning: session_start()

Problems installing LinkMan?
Post Reply
mafiouso
Posts: 4
Joined: Mon Aug 14, 2006 4:05 pm

Warning: session_start()

Post by mafiouso »

Hello,
Trying to setup the script to suit my webpage.

Works well std, but once i start adding html i get probems not the best with php.

error is:

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


-

if ($settings['autosubmit']) {
session_start();

if (empty($_SESSION['checked'])) {
$_SESSION['checked']='N';
$_SESSION['secnum']=rand(10000,99999);
$_SESSION['checksum']=$_SESSION['secnum'].$settings['filter_sum'].date('dmy');
}
if ($_SESSION['checked'] == 'N')
{
print_secimg();
}
elseif ($_SESSION['checked'] == $settings['filter_sum'])
{
$_SESSION['checked'] = 'N';
$secnumber=pj_isNumber($_POST['secnumber']);
if(empty($secnumber))
{
print_secimg(1);
}
if (!check_secnum($secnumber,$_SESSION['checksum']))
{
print_secimg(2);
}
}
else
{
problem('Internal script error. Wrong session parameters!');
}
}





if i turn off in settings.php

/* Prevent automated submissions (recommended YES)? 1 = YES, 0 = NO */
$settings['autosubmit']=0;


it will work fine.

it works fine with teh error. but can it be fixed.

i am pasting the php into a table.


would like to have what is on the demo inthscript downlaod page

thanks
mafiouso
Posts: 4
Joined: Mon Aug 14, 2006 4:05 pm

Post by mafiouso »

???
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Don't add ANY html code in the PHP files unless you know PHP well. Use header.txt/footer.txt to add HTML
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
mafiouso
Posts: 4
Joined: Mon Aug 14, 2006 4:05 pm

Post by mafiouso »

thanks,

but i would really like to know how to imbed the php into a table of html


thanks
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Then learn PHP :wink:

The problem is there mustn't be ANY html code before session headers are sent or any PHP script that uses them won't work. And unless you understand how PHP and LinkMan PHP code works you will have problems inserting HTML code in the script directly.

Please understand I'm not here to teach anyone PHP. Use the proivded header/footer files and you shouldn't get any errors.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
mafiouso
Posts: 4
Joined: Mon Aug 14, 2006 4:05 pm

Post by mafiouso »

how about an example of php in html table?

to see how it is?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Code: Select all

<table>
<tr>
<td>
<?php 

// PHP CODE HERE

?>
</td>
</tr>
</table>
would be a simple example.

But it doesn't really matter, read my previous post about any HTML being before SESSION HEADERS, meaning no HTML output must be located inside the PHP file before PHP sends out all HTTP headers. And like said again and again, unless you know PHP and understand how that works you better stick with the header/footer
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply