Session cahe limiter...

Posted on Sunday 17th June 2007 at 10:51 PM
MCP
MCP's Avatar
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. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Members Area - Change Password</title>
  5. <link rel='stylesheet' type='text/css' href='../css/style.css' />
  6. <style type="text/css">
  7. <!--
  8. .style3 {
  9. font-size: 13px;
  10. color: #000000;
  11. }
  12. .style4 {color: #FFFFFF}
  13. .style5 {
  14. color: #FFFFFF;
  15. font-weight: bold;
  16. }
  17. .style6 {color: #676767}
  18. a:link {
  19. color: #676767;
  20. }
  21. .style7 {font-size: 13px}
  22. a:visited {
  23. color: #676767;
  24. }
  25. -->
  26. </style>
  27. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
  28. <body>
  29. <table cellpadding='0' cellspacing='0' width='100%' height='100%'>
  30. <tr>
  31. <td align='center'>
  32.  
  33. <table cellpadding='0' cellspacing='0' id='sideGradient'>
  34. <tr><td align='center'><div id='header'></div>
  35. </div></td></tr>
  36. <tr><td align='center'>
  37. <table cellpadding='0' cellspacing='0' width='879'>
  38. <tr><td id='tabsHolder'>
  39. <table cellpadding='0' cellspacing='0' width='100%'><tr>
  40. <td width='66%' valign='bottom'><table width="416%" cellpadding='0' cellspacing='0' id='tab'>
  41. <tr>
  42. <td width="11" class='selLeft' />
  43. <td width="86" class='selMid'><div align="center"><a href='../index.html' class="style7">WS News</a></div></td>
  44. <td width="13" class='selRight' />
  45. <td width="11" class='unselLeft' />
  46. <td width="91" class='unselMid'><div align="center"><a href='https://www.youtube.com/FFiH'>Videos</a></div></td>
  47. <td width="15" class='unselRight' />
  48. <td width="11" class='unselLeft' />
  49. <td width="72" class='unselMid'><div align="center"><a href="../forum.php">The Forum</a></div></td>
  50. <td width="15" class='unselRight' />
  51. <td width="11" class='unselLeft' />
  52. <td width="96" class='unselMid'><div align="center"><a href='login.php'>Members Area </a></div></td>
  53. <td width="10" class='unselRight' />
  54. <td width="427"><div align="center" class="style5">NEW SITE RELEASED!</div></td>
  55. <!-- <td align='right'><font color="#888888">10.10.10.2</font></td> -->
  56. </tr>
  57. </table>
  58. <div align="right">
  59. <label></label>
  60. </div></td>
  61. </table>
  62. </td></tr>
  63. </table>
  64. </td></tr>
  65. <tr><td align='center' height='100%' class='bodyHolder'>
  66. <table cellpadding='0' cellspacing='0' height='100%' width='878'>
  67. <tr><td valign='top'>
  68. <div class="style4" id='alerts'>. </div>
  69.  
  70. <table cellpadding='0' cellspacing='0'><tr>
  71. <td width='126' valign='top' id='navCol'><table cellpadding='0' cellspacing='0' width='120'>
  72. <tr>
  73. <td class='navTitle'> Main Navigation </td>
  74. </tr>
  75. <tr>
  76. <td class='nav'><div class='navLink'><a href='../index.html'>News</a></div></td>
  77. </tr>
  78. <tr>
  79. <td class='nav'><div class='navLink'><a href='../about.html'>About WS </a></div></td>
  80. </tr>
  81. <tr>
  82. <td class='nav'><div class='navLink'><a href='../cast.html'>Cast</a></div></td>
  83. </tr>
  84. <tr>
  85. <td class='nav'><div class='navLink'><a href='../videos.html'>Videos</a></div></td>
  86. </tr>
  87. <tr>
  88. <td class='nav'><div class='navLink'><a href='../comics.html'>Comics</a></div></td>
  89. </tr>
  90. <tr>
  91. <td height='15' /> </tr>
  92. <tr>
  93. <td class='navTitle'>Members </td>
  94. </tr>
  95. <tr>
  96. <td class='nav'><div class='navLink'><a href='../forum'>The Forum</a></div></td>
  97. </tr>
  98. <tr>
  99. <td class='nav'><div class='navLink'><a href='login.php'>Members Area </a></div></td>
  100. </tr>
  101. <tr>
  102. <td class='nav'><div class='navLink'><a href='members.php'>Memberlist</a></div></td>
  103. </tr>
  104. </table></td>
  105. <td width='754' id='pageContent' valign='top'>
  106. <table cellpadding='0' cellspacing='0' width='100%'><tr><td><table cellpadding='0' cellspacing='0' width='100%'><tr><td class='content' width='100%' valign='top'>
  107. <table cellpadding='0' cellspacing='0' width='100%'>
  108. <tr>
  109. <td>
  110. <div class='post'>
  111. <table width='100%' cellpadding='0' cellspacing='0'>
  112. <tr>
  113.  
  114. <td><h2 class="style2"><span class="style6">Change Password</span></h2>
  115. <?php
  116. session_start(); //allows session
  117. include "config.php";
  118. echo "<left>";
  119. //checks see if there logged in
  120. if($logged[id])
  121. {
  122. if(isset($_GET['update'])){
  123. //posts the passwords
  124. $oldpassword = sha1(md5(md5(sha1(md5(sha1(sha1(md5($_POST[oldpassword]))))))));
  125. $newpassword = sha1(md5(md5(sha1(md5(sha1(sha1(md5($_POST[newpassword]))))))));
  126. $cnewpassword = sha1(md5(md5(sha1(md5(sha1(sha1(md5($_POST[cnewpassword]))))))));
  127. //get the users old info from the database
  128. $info = mysql_query("SELECT * FROM `members` WHERE `username` = '$logged[username]'");
  129.  
  130. $info = mysql_fetch_array($info);
  131. //if the old password matches the password in the database we continue
  132.  
  133. if($info[password] == $oldpassword) {
  134. //if the new password and conformation password are the same continue
  135.  
  136. if($newpassword == $cnewpassword) {
  137. $update = mysql_query("UPDATE `members` SET `password` = '$newpassword' WHERE `username` = '$logged[username]'");
  138. echo "<p class='error2'>Password Updated, You will need to relogin with your new password</p>";
  139. unset($_SESSION['id']);
  140. unset($_SESSION['password']);
  141. }
  142. else
  143. {
  144. echo "<p class='error'>Your new password and confirmation do not match</p>";
  145. }
  146. }
  147. else
  148. {
  149. echo "<p class='error'>Your old password does not match your current password</p>";
  150. }
  151. }
  152. else
  153. {
  154. //shows the form if not already updated
  155. echo "
  156. <form action='changepassword.php?update' method='post'>
  157. <table width='100%' border='0' cellspacing='4' cellpadding='0'>
  158. <tr>
  159. <td width='15%'>Old Password</td>
  160. <td width='87%'><input type='password' name='oldpassword' size='30' maxlength='50'></td>
  161. </tr>
  162. <tr>
  163. <td>New Password</td>
  164. <td><input type='password' name='newpassword' size='30' maxlength='50'></td>
  165. </tr>
  166. <tr>
  167. <td>Confirm Password</td>
  168. <td><input type='password' name='cnewpassword' size='30' maxlength='50'></td>
  169. </tr>
  170. <tr>
  171. <td colspan='2'><input name='submit' type='submit' value='Change'></td>
  172. </tr>
  173. </table>
  174. </form>
  175. ";
  176. }
  177. }
  178. else
  179. {
  180. echo "<p class='error'>You're not logged in</p>";
  181. }
  182. echo "<left>";
  183. ?> </td>
  184. </tr>
  185. </table>
  186. </div></td></tr>
  187. </table></td></tr>
  188. </table></td></tr>
  189. </table></td>
  190. </tr></table>
  191. </td></tr>
  192.  
  193. <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>
  194. <br>
  195. © 2007 WarCore Studios.<br>
  196. Based on Gears of War Copyright 2006 Epic Games, Inc. All Rights Reserved. <br>
  197. Read our <a class="small" href="../privacy.html">Privacy Policy</a>.</p>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td class='small' style='padding-bottom:10px;text-align:center'>&nbsp;</td>
  202. </tr>
  203. </table>
  204.  
  205. </td></tr>
  206. </table>
  207. </td></tr>
  208. </table>
  209. </td></tr></table>
  210. </body>
  211. </html>


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

and take it from the beginning of the other code
easy enit?xD
That's Just The Drill
Login or register to respond to this forum topic.