Hi everybody,
I have this problem.-
The browser launch this two errors: -
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
-
-
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
-
The code of verificaEntrada is: - <?php
-
session_start();
-
if(strlen($_POST[Xlogin])>4 && strlen($_POST[Xpass])==32){
-
$manejadorUsuerio = new ManejadorUsuario();
-
if($manejadorUsuerio->existeUsuario($_POST[Xlogin],$_POST[Xpass])){
-
$usuario=$manejadorUsuerio->getUsuario();
-
$_SESSION['nombre']=$usuario->getNombre() . ' ' . $usuario->getApellido();
-
$_SESSION['usuario']=$usuario;
-
$_SESSION['time']=time();
-
header("Location: index.php");
-
}else{
-
header("Location: login.php?error=unregister");
-
}
-
}else{
-
echo "Error en parametros";
-
}
-
-
function __autoload($class_name) {require_once $class_name . '.php';}
-
?>
and the code of Administrador is: - <?php
-
class Administrador{
-
private $id;
-
private $login;
-
private $password;
-
private $nombre;
-
private $apellido;
-
private $nickname;
-
private $email;
-
private $telefono1;
-
private $telefono2;
-
-
public function __construct($id,$login,$password,$nombre,$apellido,$nickname,$email,$telefono1,$telefono2)
-
{
-
$this->id = $id;
-
$this->login = $login;
-
$this->password = $password;
-
$this->nombre = $nombre;
-
$this->apellido = $apellido;
-
$this->nickname = $nickname;
-
$this->email = $email;
-
$this->telefono1 = $telefono1;
-
$this->telefono2 = $telefono2;
-
}
-
-
public function getId(){return $this->id;}
-
public function getLogin(){return $this->login;}
-
public function getPassword(){return $this->password;}
-
public function getNombre(){return $this->nombre;}
-
public function getApellido(){return $this->apellido;}
-
public function getNickname(){return $this->nickname;}
-
public function getEmail(){return $this->email;}
-
public function getTelefono1(){return $this->telefono1;}
-
public function getTelefono2(){return $this->telefono2;}
-
-
public function setId($id){$this->id=$id;}
-
public function setLogin($login){$this->login=$login;}
-
public function setPassword($password){$this->password=$password;}
-
public function setNombre($nombre){$this->nombre=$nombre;}
-
public function setApellido($apellido){$this->apellido=$apellido;}
-
public function setNickname($nickname){$this->nickname=$nickname;}
-
public function setEmail($email){$this->email=$email;}
-
public function setTelefono1($telefono1){$this->telefono1=$telefono1;}
-
public function setTelefono2($telefono2){$this->telefono2=$telefono2;}
-
}
-
?>
Somebody help me please!
Thanks!
3 2821
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.
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!
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 :)
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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)
{
|
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...
|
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...
|
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
|
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',...
|
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...
|
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...
|
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);
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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,...
| |