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 2847 pbmods 5,821
Recognized Expert Expert
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!
pbmods 5,821
Recognized Expert Expert
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 'click' in the form entry
box). After you hit refresh it works fine. IE doesn't report any error
(reporting is turned on). It also works fine if I remove the
"session_start()". Is this an IE bug or am I doing something wrong?
Is there a fix or...
|
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 storage Keywords.Keyword reachable from global
A global variable does not satisfy its annotations when control
is transferred. (Use -globstate to inhibit warning)
keywords.c:60:11: Storage Keywords.Keyword 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 these work. When
I transfer my site to my webhost, all of these no longer function
within the session_start. All of these functions work correctly when
triggered by button clicks or page redirects, the session_start simply
won't fire. I have 3...
|
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', TRUE)
before session_start() do I see anything, it just plain dies.
I used LiveHTTPHeaders to verify that I am getting a 200 OK response,
thus everything seems OK except that it's dying on session_start().
Sometimes.
|
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 Function 'Dec2hms' doesn't return a value on all code paths. A
null reference exception could occur at run time when the result is used.
|
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 not a valid MySQL
result resource in /home/jplane/certcent/phpweb/quiz/index.php on line
21
PHP CODE:
|
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 already talk about this
issue. But I still confused..
This is the simple test code I copied from these messages
////////////////////////////////////////////////////////////////////
class Base {
virtual void foo(); //*position A*
};
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |