He instalado un nuevo sistema de login, mas complejo, y ahora cuando lo subo a mi dominio me da un error al autenticar el usuario!
Me pone todos estos errores
Warning: session_start() [function.session-start]: open(tmp/sess_2d2b8fb573d9fca06509f8699c7f1566, O_RDWR) failed: No such file or directory (2) in /home/jordvsyh/public_html/login/validar_usuari.php on line 7
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/jordvsyh/public_html/login/validar_usuari.php:7) in /home/jordvsyh/public_html/login/validar_usuari.php on line 7
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/jordvsyh/public_html/login/validar_usuari.php:7) in /home/jordvsyh/public_html/login/validar_usuari.php on line 7
Warning: Cannot modify header information - headers already sent by (output started at /home/jordvsyh/public_html/login/validar_usuari.php:7) in /home/jordvsyh/public_html/login/validar_usuari.php on line 27
Warning: Unknown: open(tmp/sess_2d2b8fb573d9fca06509f8699c7f1566, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (tmp) in Unknown on line 0
ya no se que hacer!
y la pagina es codigo solo php
miren el codigo:
Código PHP:
<?php
// Configura los datos de tu cuenta
$dbhost='localhost';
$dbusername='usuario';
$dbuserpass='password';
$dbname='base_de_datos';
session_start();
// Conectar a la base de datos
mysql_connect ($dbhost, $dbusername, $dbuserpass);
mysql_select_db($dbname) or die('Cannot select database');
if ($_POST['username']) {
//Comprobacion del envio del nombre de usuario y password
$username=$_POST['username'];
$password=$_POST['password'];
if ($password==NULL) {
echo "La password no fue enviada";
}else{
$query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($query);
if($data['password'] != $password) {
echo "Login incorrecto";
}else{
$query = mysql_query("SELECT username,password FROM users WHERE username = '$username' and password='$password'") or die(mysql_error());
$row = mysql_fetch_array($query);
$_SESSION["s_username"] = $row['username'];
$_SESSION["s_password"] = $row['password'];
header ("Location: membres.php");
}
}
}
?>
JF