Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 523
0 Users 3 Guests Online
Forum Index » PHP + MySQL » Session cahe limiter...
Posted on Sunday 17th June 2007 at 10:51 PM
MCP
templates/default/images/noavatar.png's Avatar
Junior Member
There is the error below.

Code
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/warcor/public_html/members/changepassword.php:6) in /home/warcor/public_html/members/changepassword.php on line 116


And here is my page. That error appears on all of the pages but this page is an example.

PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Members Area - Change Password</title>
<link rel='stylesheet' type='text/css' href='../css/style.css' />
<style type="text/css">
<!--
.style3 {
    font-size: 13px;
    color: #000000;
}
.style4 {color: #FFFFFF}
.style5 {
    color: #FFFFFF;
    font-weight: bold;
}
.style6 {color: #676767}
a:link {
    color: #676767;
}
.style7 {font-size: 13px}
a:visited {
    color: #676767;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<table cellpadding='0' cellspacing='0' width='100%' height='100%'>
    <tr>
        <td align='center'>

            <table cellpadding='0' cellspacing='0' id='sideGradient'>
<tr><td align='center'><div id='header'></div>
</div></td></tr>
<tr><td align='center'>
    <table cellpadding='0' cellspacing='0' width='879'>
    <tr><td id='tabsHolder'>
        <table cellpadding='0' cellspacing='0' width='100%'><tr>
        <td width='66%' valign='bottom'><table width="416%" cellpadding='0' cellspacing='0' id='tab'>
          <tr>
            <td width="11" class='selLeft' />        
            <td width="86" class='selMid'><div align="center"><a href='../index.html' class="style7">WS News</a></div></td>
            <td width="13" class='selRight' />        
            <td width="11" class='unselLeft' />        
            <td width="91" class='unselMid'><div align="center"><a href='http://www.youtube.com/FFiH'>Videos</a></div></td>
            <td width="15" class='unselRight' />        
            <td width="11" class='unselLeft' />        
            <td width="72" class='unselMid'><div align="center"><a href="../forum.php">The Forum</a></div></td>
            <td width="15" class='unselRight' />        
            <td width="11" class='unselLeft' />        
            <td width="96" class='unselMid'><div align="center"><a href='login.php'>Members Area </a></div></td>
            <td width="10" class='unselRight' />        
            <td width="427"><div align="center" class="style5">NEW SITE RELEASED!</div></td>          
            <!-- <td align='right'><font color="#888888">10.10.10.2</font></td> -->
          </tr>
          </table>
          <div align="right">
            <label></label>
          </div></td>
        </table>
    </td></tr>
    </table>
</td></tr>
<tr><td align='center' height='100%' class='bodyHolder'>
    <table cellpadding='0' cellspacing='0' height='100%' width='878'>
        <tr><td valign='top'>
        <div class="style4" id='alerts'>. </div>

        <table cellpadding='0' cellspacing='0'><tr>
            <td width='126' valign='top' id='navCol'><table cellpadding='0' cellspacing='0' width='120'>
              <tr>
                <td class='navTitle'>                  Main Navigation </td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../index.html'>News</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../about.html'>About WS </a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../cast.html'>Cast</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../videos.html'>Videos</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../comics.html'>Comics</a></div></td>
              </tr>
              <tr>
                <td height='15' />              </tr>
              <tr>
                <td class='navTitle'>Members </td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../forum'>The Forum</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='login.php'>Members Area </a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='members.php'>Memberlist</a></div></td>
              </tr>
            </table></td>
            <td width='754' id='pageContent' valign='top'>
<table cellpadding='0' cellspacing='0' width='100%'><tr><td><table cellpadding='0' cellspacing='0' width='100%'><tr><td class='content' width='100%' valign='top'>
            <table cellpadding='0' cellspacing='0' width='100%'>
                <tr>
                    <td>
            <div class='post'>
                <table width='100%' cellpadding='0' cellspacing='0'>
                    <tr>

                        <td><h2 class="style2"><span class="style6">Change Password</span></h2>
                          <?php
session_start
(); //allows session
include "config.php";
echo 
"<left>";
//checks see if there logged in
if($logged[id]) 

if(isset(
$_GET['update'])){
//posts the passwords
$oldpassword sha1(md5(md5(sha1(md5(sha1(sha1(md5($_POST[oldpassword])))))))); 
$newpassword sha1(md5(md5(sha1(md5(sha1(sha1(md5($_POST[newpassword]))))))));
$cnewpassword sha1(md5(md5(sha1(md5(sha1(sha1(md5($_POST[cnewpassword]))))))));
//get the users old info from the database
$info mysql_query("SELECT * FROM `members` WHERE `username` = '$logged[username]'"); 

$info mysql_fetch_array($info);
//if the old password matches the password in the database we continue

if($info[password] == $oldpassword) {
//if the new password and conformation password are the same continue

if($newpassword == $cnewpassword) {
$update mysql_query("UPDATE `members` SET `password` = '$newpassword' WHERE `username` = '$logged[username]'");
echo 
"<p class='error2'>Password Updated, You will need to relogin with your new password</p>";
unset(
$_SESSION['id']);
unset(
$_SESSION['password']);
}
else
{
echo 
"<p class='error'>Your new password and confirmation do not match</p>";
}
}
else
{
echo 
"<p class='error'>Your old password does not match your current password</p>";
}
}
else
{
//shows the form if not already updated
echo "
<form action='changepassword.php?update' method='post'>
<table width='100%' border='0' cellspacing='4' cellpadding='0'>
  <tr>
    <td width='15%'>Old Password</td>
    <td width='87%'><input type='password' name='oldpassword' size='30' maxlength='50'></td>
  </tr>
  <tr>
    <td>New Password</td>
    <td><input type='password' name='newpassword' size='30' maxlength='50'></td>
  </tr>
  <tr>
    <td>Confirm Password</td>
    <td><input type='password' name='cnewpassword' size='30' maxlength='50'></td>
  </tr>
  <tr>
    <td colspan='2'><input name='submit' type='submit' value='Change'></td>
  </tr>
</table>
</form>
"
;
}
}
else
{
echo 
"<p class='error'>You're not logged in</p>";
}
echo 
"<left>";
?> </td>
                    </tr>
                </table>
            </div></td></tr>
                    </table></td></tr>
                    </table></td></tr>
                    </table></td>    
                    </tr></table>
                    </td></tr>
                
        <tr><td valign='bottom' align='right' style='padding-top:36px'><table cellpadding='0' cellspacing='0' width='754'><tr><td class='small' style='padding-bottom:10px;text-align:center'><p><a class='small' href='../contact.html'>Contact Information</a><br>
                <br>
  © 2007 WarCore Studios.<br>
          Based on Gears of War Copyright 2006 Epic Games, Inc. All Rights Reserved. <br>
          Read our <a class="small"  href="../privacy.html">Privacy Policy</a>.</p>
            </td>
        </tr>
        <tr>
          <td class='small' style='padding-bottom:10px;text-align:center'>&nbsp;</td>
          </tr>
        </table>
        
        </td></tr>
    </table>
</td></tr>
</table>
</td></tr></table>
</body>
</html>


Any ideas on how to fix this?
Posted on Monday 18th June 2007 at 01:34 AM
gbt91
templates/default/images/noavatar.png's Avatar
Junior Member
Actually Sessions suppose to start before any code so put at the top of the page this...
PHP Code
1
2
3
4
<?php
session_start
(); //allows session 
?>

and take it from the beginning of the other code
easy enit?xD