Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/04/2016, 22:11
andrinson
 
Fecha de Ingreso: enero-2016
Mensajes: 63
Antigüedad: 8 años, 3 meses
Puntos: 0
Respuesta: problemas con el echo "<script type='text/javascript'>alert

A mi me funciona haci:
<!DOCTYPE php>
<html>
<head>
<head>
<title>Validando...Por favor espere</title>
<meta charset="utf-8">
</head>
</head>
<body
<?php
include "conexioningreso.php";
if(isset($_POST['login'])){
$usuario = htmlentities($_POST['user']);
$pw = htmlentities($_POST['pw']);
$goto = "form1.php";
$log = mysql_query("SELECT * FROM registroempresa WHERE user='$usuario' AND pw='$pw'");
if(mysql_num_rows($log)>0){
$row = mysql_fetch_array($log);
$_SESSION["user"] = $row['user'];
$_SESSION["idEmpresa"] = $row['idEmpresa'];
$_SESSION["nombreEmpresa"] = $row['nombreEmpresa'];
echo '<script> window.location='.$goto.'; </script>';
}else{
echo '<script>alert("Usuario o contrasena incorrectos no existe"); history.back();</script>';
}
}
?>
</body>
</html>