473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Warning: session_start() [function.session-start]: Cannot send session cache limiter

Hi everybody,

I have this problem.-
The browser launch this two errors:
Expand|Select|Wrap|Line Numbers
  1. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/notasluz/public_html/administrador/Administrador.php:1) in /home/notasluz/public_html/administrador/verificaEntrada.php on line 2
  2. 
  3. Warning: Cannot modify header information - headers already sent by (output started at /home/notasluz/public_html/administrador/Administrador.php:1) in /home/notasluz/public_html/administrador/verificaEntrada.php on line 10
  4.  
The code of verificaEntrada is:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. if(strlen($_POST[Xlogin])>4 && strlen($_POST[Xpass])==32){
  4.     $manejadorUsuerio = new ManejadorUsuario();
  5.     if($manejadorUsuerio->existeUsuario($_POST[Xlogin],$_POST[Xpass])){
  6.         $usuario=$manejadorUsuerio->getUsuario();
  7.         $_SESSION['nombre']=$usuario->getNombre() . ' ' . $usuario->getApellido();
  8.         $_SESSION['usuario']=$usuario;
  9.         $_SESSION['time']=time();
  10.         header("Location: index.php");
  11.     }else{
  12.         header("Location: login.php?error=unregister");
  13.     }
  14. }else{
  15.     echo "Error en parametros";
  16. }
  17.  
  18. function __autoload($class_name) {require_once $class_name . '.php';}
  19.  ?>
and the code of Administrador is:

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. class Administrador{
  3.     private $id;
  4.     private $login;
  5.     private $password;
  6.     private $nombre;
  7.     private $apellido;
  8.     private $nickname;
  9.     private $email;
  10.     private $telefono1;
  11.     private $telefono2;
  12.  
  13.     public function __construct($id,$login,$password,$nombre,$apellido,$nickname,$email,$telefono1,$telefono2)
  14.     {
  15.         $this->id = $id;
  16.         $this->login = $login;
  17.         $this->password = $password;
  18.         $this->nombre = $nombre;
  19.         $this->apellido = $apellido;
  20.         $this->nickname = $nickname;
  21.         $this->email = $email;
  22.         $this->telefono1 = $telefono1;
  23.         $this->telefono2 = $telefono2;
  24.     }
  25.  
  26.     public function getId(){return $this->id;}
  27.     public function getLogin(){return $this->login;}
  28.     public function getPassword(){return $this->password;}
  29.     public function getNombre(){return $this->nombre;}
  30.     public function getApellido(){return $this->apellido;}
  31.     public function getNickname(){return $this->nickname;}
  32.     public function getEmail(){return $this->email;}
  33.     public function getTelefono1(){return $this->telefono1;}
  34.     public function getTelefono2(){return $this->telefono2;}
  35.  
  36.     public function setId($id){$this->id=$id;}
  37.     public function setLogin($login){$this->login=$login;}
  38.     public function setPassword($password){$this->password=$password;}
  39.     public function setNombre($nombre){$this->nombre=$nombre;}
  40.     public function setApellido($apellido){$this->apellido=$apellido;}
  41.     public function setNickname($nickname){$this->nickname=$nickname;}
  42.     public function setEmail($email){$this->email=$email;}
  43.     public function setTelefono1($telefono1){$this->telefono1=$telefono1;}
  44.     public function setTelefono2($telefono2){$this->telefono2=$telefono2;}
  45. }
  46.  ?>
Somebody help me please!

Thanks!
Sep 29 '07 #1
3 2821
pbmods
5,821 Expert 4TB
Heya, Mrosado. Welcome to TSDN!

You are getting this warning because your script outputs something before you call session_start().

Double check all your files for whitespace before the opening '<?php' tag.
Sep 30 '07 #2
Thank you.-

But the problem was the codification of the file. I'm having problems with UTF-8 and the BOM. I saw in other forum that this codificatión send 3 invisible caracters at start and it's somithing like header, so that 's why the browser lounch the error.

Thanks again! I hope this could help other people with similar errors!
Sep 30 '07 #3
pbmods
5,821 Expert 4TB
Heya, Mrosado.

Thanks for posting your solution.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Sep 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Paul | last post by:
Dear experts, I have a problem with session_start() and JavaScript. In IE6 (but not Mozilla) the first time the page below loads the JavaScript doesn't work (clicking on the graphic should write...
29
by: junky_fellow | last post by:
Consider the following piece of code: struct junk { int i_val; int i_val1; char c_val; }; int main(void) {
3
by: Bas Wassink | last post by:
Hello there, I'm having trouble understanding a warning produced by 'splint', a code-checker. The warning produced is: keywords.c: (in function keyw_get_string) keywords.c:60:31: Released...
0
by: Jason Lehman | last post by:
When testing on my local machine, the session_start fires fine. I try storing a value to my database, creating a timestamped text file, and writing a line of text to a general log file. All of...
22
by: pemo | last post by:
ISO C does not allow extra ';' outside of a function int n;; int main(void) { .... } Anyone care to enlighten me as to why ISO C does not allow this, but
6
by: comp.lang.php | last post by:
I am using session_start() on index.php and for some reason sometimes it'll fail. No warnings, no errors, no notices, not even after prepending error_reporting(E_ALL) and ini_set('display_errors',...
27
by: Terry | last post by:
I am getting the following warning for the below function. I understand what it means but how do I handle a null reference? Then how do I pass the resulting value? Regards Warning 1...
2
by: techjohnny | last post by:
Error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/jplane/certcent/phpweb/quiz/index.php on line 20 Warning: mysql_num_rows(): supplied argument is...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
10
by: asm23 | last post by:
Hi, I'm using Intel C++ compiler 9 to compiler a project. But, there are a lot of warning saying like "virtual function override intended....". I searched old messages in Google groups, someone...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.