| | |
Warning: session_start() [function.session-start]: Cannot send session cache limiter
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2009
Posts: 2
Reputation:
Solved Threads: 0
Warning: session_start() [function.session-start]: Cannot send session cache limiter
0
#1 Jul 22nd, 2009
I am getting this problem whenever I login from index.php to admin_area.php. I am giving the codes of the two files. Please help.
Index.php
admin_area.php
Please help me as soon as possible
Index.php
php Syntax (Toggle Plain Text)
<?php session_start(); include("../lib/globals.php"); if(isset($_REQUEST['submit'])) { $u_name=$_REQUEST['username']; $pass=$_REQUEST['password']; $sql="select * from `user_table_master` where `user_name`='$u_name' and `password`='$pass'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $num_of_rows=mysql_num_rows($result); if($num_of_rows>0) { $_SESSION['logged_in']='y'; $_SESSION['user_type']=$row['user_type']; $_SESSION['user_formation']=$row['formation']; $_SESSION['user_name']=$row['user_name']; $_SESSION['name']=$row['name']; $_SESSION['user_id']=$row['user_id']; $_SESSION['can_see_remarks']=$row['can_see_remarks']; ?> <script language="JavaScript"> document.location.href='admin_area.php'; </script> <?php } else { ?> <script language='javascript'> alert("Either 'UserName' or 'PassWord' is incorrect"); </script> <?php } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>SMERians' Corner</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="../style/style.css" rel="stylesheet" type="text/css"> <script language="javascript"> function validate() { var username=document.f1.username.value; var password=document.f1.password.value; if(username=="") { alert('Please enter Login Id.'); document.f1.username.focus(); return false; } if(password=="") { alert('Please enter Password.'); document.f1.password.focus(); return false; } } </script> </head> <body leftmargin="0" topmargin="0" alink="#000000" vlink="#000000" link="#000000"> <table width='100%' height="117" border='0' cellspacing="0"> <tr height="60"> <td align="center" bgcolor="#2A166F" class="sty1"> <table id="Table_01" width="567" height="90" border="0" cellpadding="0" cellspacing="0"> <tr bgcolor="00AEEF"> <td width="530" align="center" valign="middle" bgcolor="#2A166F"> <font size="+5"><img src="../images/ADMIN1.gif"></font></td> </tr> </table> </td> </tr> <tr height="2px"><td bgcolor="#FFFFFF"></td></tr> <tr height="4px"><td align="right" bgcolor="00aeef"></td></tr> </table> <form name="f1" method="post" action="index.php" onSubmit="return validate();"> <p> </p> <p> </p> <table width="36%" border="0" align="center" cellspacing="0" cellpadding="0" class="tab_sty1" bgcolor="00AEEF"> <tr bgcolor="#000000" height="20"><td colspan="4" class="mysty1"><div align="center"><font color="#FFFFFF"><b>SMERians' Login</b></font></div></td></tr> <tr><td><div align="center"></div></td> <td> </td> <td> </td> <td width="45%" rowspan="6"><img src="../images/key.jpg" width="150" height="112"></td> </tr> <tr><td> </td> <td> </td> <td> </td> </tr> <tr> <td width="27%" align="center" class="mysty2"><div align="right"> Login ID : </div></td> <td width="2%"> </td> <td width="26%" align="left"><input name="username" type="text" id="username" size="15" maxlength="20"></td> </tr> <tr> <td align="center" class="mysty2"><div align="right">Password : </div></td> <td> </td> <td align="center"><div align="left"><input name="password" type="password" id="password" size="15"></div></td> </tr> <tr><td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr> <tr><td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr> <tr><td align="center" colspan="4"><input type="submit" name="submit" value="Submit" ></td></tr> <tr><td colspan="4"> </td></tr> </table> </form> </body> </html>
admin_area.php
php Syntax (Toggle Plain Text)
<?php session_start(); if(!empty($_SESSION['logged_in'])) { $user_name=$_SESSION['user_name']; $user_type=$_SESSION['user_type']; ?> <html> <head> <title>SMERians' Corner</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="../style/style.css" rel="stylesheet" type="text/css"> <script language="javascript"> function validate() { var username=document.f1.username.value; var password=document.f1.password.value; if(username=="") { alert('Please enter Login Id.'); document.f1.username.focus(); return false; } if(password=="") { alert('Please enter Password.'); document.f1.password.focus(); return false; } } </script> <style type="text/css"> <!-- .style12 {font-size: 16px} --> </style> </head> <body leftmargin="0" topmargin="0" alink="#000000" vlink="#000000" link="#000000" onLoad="startclock()"> <?php include("admin_header.php");?> <table width='98%' border='0' cellspacing="0"> <tr> <td width="190" align="left" valign="top"><?php include("admin_left.php"); ?></td> <td align="center" valign="top"> <table width="800" border="0" align="center"> <tr><td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000000"><? echo date('d-m-Y'); ?> <span id="showDate"></span></font></td></tr> </table> <br><br><br> <table width="500" border="0" align="center"> <tr> <td class="text4"> <div align="center"> <?php if (isset($_GET['val'])) { ?> <font size="+2">You Are Not An Authorised User To See This Page</font> <?php } else { ?> <font color="00aeef" size="+2"> Welcome <?php echo"'".$_SESSION['name']."'"; ?></font> <?php } ?> </div> </td> </tr> </table> </td> </tr> </table> </body> </html> <?php } else { header("location:index.php"); } ?>
Please help me as soon as possible
Last edited by peter_budo; Jul 22nd, 2009 at 2:56 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Re: Warning: session_start() [function.session-start]: Cannot send session cache limiter
0
#2 Jul 22nd, 2009
Re: Warning: session_start() [function.session-start]: Cannot send session cache limiter
0
#3 Jul 22nd, 2009
Be sure that session_start(); is the first line in each of your codes without spaces or blank lines.
PHP Syntax (Toggle Plain Text)
<?php session_start(); ............................ ?>
•
•
Join Date: Jul 2009
Posts: 2
Reputation:
Solved Threads: 0
Re: Warning: session_start() [function.session-start]: Cannot send session cache limi
0
#4 Jul 22nd, 2009
•
•
•
•
Be sure that session_start(); is the first line in each of your codes without spaces or blank lines.
PHP Syntax (Toggle Plain Text)
<?php session_start(); ............................ ?>
Thank You Very Much. There was a space before the <?php tag.
It solved my problem. Thanks
Re: Warning: session_start() [function.session-start]: Cannot send session cache limi
0
#5 Jul 22nd, 2009
Glad you got it fixed, please mark this thread solved.
Re: Warning: session_start() [function.session-start]: Cannot send session cache limiter
0
#6 Jul 22nd, 2009
Dear friend
Can you please remove the session_start(), because they already start the seecion in include("../lib/globals.php"); file , these reason only show this error
THanks
Can you please remove the session_start(), because they already start the seecion in include("../lib/globals.php"); file , these reason only show this error
THanks
![]() |
Similar Threads
- Warning: session_start() [function.session-start]: Cannot send session cache limiter (PHP)
- Warning: session_start(): Cannot send session cache limiter - headers already sent (PHP)
- session_start() warning is coming???? (PHP)
- Small problem with plaincart php, cache limiter (PHP)
- session variable error (PHP)
- help with oscommerce (eCommerce)
Other Threads in the PHP Forum
- Previous Thread: mysql_fetch_array error
- Next Thread: customised the locked textboxes and save as new data
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array autosuggest beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email emptydisplayvalue error explodefunction file files folder form forms function functions google hack href htaccess html image include insert integration ip java javascript joomla keywords limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search searchbox select server sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video web website xml youtube





