Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/09/2010, 01:05
Sofmundi
 
Fecha de Ingreso: enero-2010
Mensajes: 302
Antigüedad: 14 años, 4 meses
Puntos: 3
Respuesta: Porque este script no se me ejecuta

a q te refieres de quitar a q no coloque <script>, aca lo utilizo

Código PHP:
<?php require_once('Connections/Activos3.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}
mysql_select_db($database_Activos3$Activos3);
$query_Activos_Login_Usuario "SELECT * FROM usuarios ORDER BY nivel ASC";
$Activos_Login_Usuario mysql_query($query_Activos_Login_Usuario$Activos3) or die(mysql_error());
$row_Activos_Login_Usuario mysql_fetch_assoc($Activos_Login_Usuario);
$totalRows_Activos_Login_Usuario mysql_num_rows($Activos_Login_Usuario);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  
session_start();
}
$loginFormAction $_SERVER['PHP_SELF'];
if (isset(
$_GET['accesscheck'])) {
  
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset(
$_POST['usuario'])) {
  
$loginUsername=$_POST['usuario'];
  
$password=$_POST['password'];
  
$MM_fldUserAuthorization "nivel";
  
$MM_redirectLoginSuccess "Administrador/inicio.php";
  
$MM_redirectLoginSuccess2 "Consulta/inicio.php";
  
$MM_redirectLoginSuccess3 "Supervisor/inicio.php";
  
$MM_redirectLoginFailed "index.php";
  
$MM_redirecttoReferrer false;
  
mysql_select_db($database_Activos3$Activos3);
  
$LoginRS__query=sprintf("SELECT usuario, clave, nivel FROM usuarios WHERE usuario=%s AND clave=%s",
  
GetSQLValueString($loginUsername"text"), GetSQLValueString($password"text")); 
  
$LoginRS mysql_query($LoginRS__query$Activos3) or die(mysql_error());
  
$loginFoundUser mysql_num_rows($LoginRS);
  if (
$loginFoundUser) {
    
$loginStrGroup  mysql_result($LoginRS,0,'nivel');
    
//declare two session variables and assign them
    
$_SESSION['MM_Username'] = $loginUsername;
    
$_SESSION['MM_UserGroup'] = $loginStrGroup;          
    if (isset(
$_SESSION['PrevUrl']) && false) {
      
$MM_redirectLoginSuccess $_SESSION['PrevUrl'];    
    }
      if(
$loginStrGroup==1) { header("Location: " $MM_redirectLoginSuccess ); }//redirecciona a administrador
      
if($loginStrGroup==2) { header("Location: " $MM_redirectLoginSuccess2 ); }//redirecciona a consulta
      
if($loginStrGroup==3) { header("Location: " $MM_redirectLoginSuccess3 ); }//redirecciona a supervisor
  
}
  else {
    
header("Location: "$MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de Inventario</title>
<link href="CSS/estilo.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="JS/validacion.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script language="JavaScript">
<!-- Por Carlitos. Cualquier duda o pregunta, visita www.forosdelweb.com
var ancho=400
var alto=460
var fin=750
var x=20
var y=20
function inicio()
{
    ventana = window.open("email/mailattach.php", "_blank", "resizable,height=1,width=1,top=x,left=y,screenX=x,screenY=y");
    abre();
}
function abre()
{
    if (ancho<=fin) {
        ventana.moveTo(5,5); // fijos
        ventana.resizeTo(400,515); //fijos
//        x+=5 aumenta cada ves q se abre
//        y+=5
//        ancho+=15
//        alto+=15
        timer= setTimeout("abre()",1)
    }
    else {
        clearTimeout(timer)
        }
}
// -->
</script>
<div id="contenedor">
<div id="cabecera"><center><img src="Imagenes/Titulo3.PNG"  alt="Sistema de Inventario" border="0" class="imagen"></center></div>
<h1>&nbsp;</h1>
<div id="login">
<h2>Ingreso de Usuario</h2>
<form action="<?php echo $loginFormAction?>" method="POST" name="ingreso" id="ingreso">
  <table width="234" border="0" align="center">
    <tr>
      <td width="77" class="inserta_tablas1"><strong>Usuario:</strong></td>
      <td width="147">
        <input type="text" name="usuario" id="usuario" />        
    </tr>
    <tr>
      <td class="inserta_tablas1"><strong>Contraseña:</strong></td>
      <td>
          <input type="password" name="password" id="password" />
    </tr>
    <tr>
      <td class="inserta_tablas1">&nbsp;</td>
      <td><label>
        <input type="submit" name="button" id="button" value="Enviar" class="boton" onclick="return Ingreso();"/>
        <input type="reset" name="button2" id="button2" value="Restablecer" />
      </label></td>
    </tr>
  </table>
</form>
</div>
<div id="pie">
<center>
  <p>Recomendamos usar Firefox 2.0 o Superior, y javascript activado para mejor funcionamiento del sistema.</p>
  <p>&nbsp;</p>
  <p>Sistema de Inventario Realizado por <a href= "index.php" class="enlacenav" onclick="inicio()"title= "Enviar E-Mail">Anward Acosta &copy; 2009</a></p>
</center>
</div>
</div>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_result
($Activos_Login_Usuario);
?>