Ver Mensaje Individual
  #9 (permalink)  
Antiguo 21/02/2010, 09:33
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 1 mes
Puntos: 6
Respuesta: cambiar boton al iniciar sesion

Aqui te dejo el codigo esntero de cuando se pulsa el boton de iniciar sesion, aver si me puedes ayudar mejor:


iniciando.php
Código PHP:
<?php
ob_start
();

include(
"config.php"); 

// connect to the mysql server 
$link mysql_connect($server$db_user$db_pass
or die (
"ERROR: MYSQL ".mysql_error()); 

// select the database
mysql_select_db($database
or die (
"ERROR: MYSQL ".mysql_error()); 

$match "select id from $table where username = '".$_POST['username']."' 
and password = '"
.$_POST['password']."';"

$qry mysql_query($match
or die (
"ERROR: MYSQL ".mysql_error()); 
$num_rows mysql_num_rows($qry); 

if (
$num_rows <= 0) { 
echo 
"El nombre de usuario o contraseña son incorrectos: <strong>".$_POST['username']."</strong><br>"
echo 
"<a href=iniciar.html>Volver Atras</a>"
exit;

} else { 

setcookie("loggedin""".$_POST['username'].""time()+(3600 24));
echo 
"Bienvenido: <strong>".$_POST['username']."</strong><br>"
echo 
"Continue a la web <a href=index.html>Pulsa aqui</a>."
}
ob_end_flush();
?>