View Full Version : I just downloaded a script...could someone help debug it?

07-02-2007, 06:52 AM
There seem to be some problems with this script...can anyone figure out how to fix them? (They're not too big)

This page: (admin.php)

if (@$_SESSION['loggedin'] == 1){
You are currently loggedin.<br>
You will automatically be logged out if you return to the SMS main page.<br>
You may select a sorting pattern or click submit to view messages with default sorting.<br><br>
<form action="messages.php" method="post">
<input type='checkbox' name="sortbyname">
sort by name
<input type='checkbox' name="sortbydate">
sort by date <br />
<br />
<input type='submit' name="passsubmit" value="SUBMIT" />
echo "<p><a href='sms3.php'>Click here to logout</a></p>";


Gives me:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at include.php:58) in admin.php on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at include.php:58) in admin.php on line 3

and here's lines 50-65 in include.php:

$pagenext = $_REQUEST['pagenext'];
$pageprev = $_REQUEST['pageprev'];
<!-- Header data -->
<script type="text/javascript" src="/overlibmws/overlibmws.js"></script>
<title>Simple Message System 3.0</title>
<SCRIPT LANGUAGE="Javascript">
function decision(message, url){
if(confirm(message)) location.href = url;
// --->

07-02-2007, 08:34 AM


looks like the error is because the header is sent before the session is started.
switching those lines should fix it if I'm not mistaken.

07-02-2007, 01:49 PM
that fixed it...and the other problem was caused by a comment..