Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/10/2010, 14:14
Avatar de mexbale
mexbale
 
Fecha de Ingreso: septiembre-2010
Ubicación: Iztapalapa
Mensajes: 146
Antigüedad: 14 años, 2 meses
Puntos: 1
Respuesta: problema con echo

Código PHP:
Ver original
  1. <?php
  2. //initialize the session
  3. if (!isset($_SESSION)) {
  4. }
  5.  
  6. // ** Logout the current user. **
  7. $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
  8. if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  9.   $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
  10. }
  11.  
  12.  
  13. ?>
  14. <?php
  15. if (!function_exists("GetSQLValueString")) {
  16. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  17. {
  18.   $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  19.  
  20.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  21.  
  22.   switch ($theType) {
  23.     case "text":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;    
  26.     case "long":
  27.     case "int":
  28.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  29.       break;
  30.     case "double":
  31.       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  32.       break;
  33.     case "date":
  34.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  35.       break;
  36.     case "defined":
  37.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  38.       break;
  39.   }
  40.   return $theValue;
  41. }
  42. }
  43.  
  44. $editFormAction = $_SERVER['PHP_SELF'];
  45. if (isset($_SERVER['QUERY_STRING'])) {
  46.   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
  47. }
  48.  
  49.  
  50. ?>
  51.  
  52. <?php require_once('localhost1.php'); ?>  
  53. <?php
  54. // *** Validate request to login to this site.
  55. if (!isset($_SESSION)) {
  56. }
  57.  
  58. $loginFormAction = $_SERVER['PHP_SELF'];
  59. if (isset($_GET['accesscheck'])) {
  60.   $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  61. }
  62.  
  63. if (isset($_POST['Nombre'])) {
  64.   $loginUsername=$_POST['Nombre'];
  65.   $MM_fldUserAuthorization = "";
  66.   $MM_redirectLoginSuccess = "tabular.php";
  67.   $MM_redirectLoginFailed = "index.php";
  68.   $MM_redirecttoReferrer = false;
  69.   mysql_select_db($database_localhost, $localhost);
  70.  
  71. //  $LoginRS__query=sprintf("SELECT usr, passwd FROM usuarios_sha1 WHERE usr=%s AND passwd=%s",
  72.   $LoginRS__query=sprintf("SELECT * FROM tabular WHERE folio='$loginUsername'",
  73.  
  74.     GetSQLValueString($loginUsername, "text"));
  75.    
  76.   $LoginRS = mysql_query($LoginRS__query, $localhost) or die(mysql_error());
  77.   $loginFoundUser = mysql_num_rows($LoginRS);
  78.   if ($loginFoundUser) {
  79.      $loginStrGroup = "";
  80.      
  81.     //declare two session variables and assign them
  82.     $_SESSION['MM_Username'] = $loginUsername;
  83.     //$_SESSION['MM_Id'] = $loginRS[2];
  84.  
  85.  
  86.     if (isset($_SESSION['PrevUrl']) && false) {
  87.       $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; 
  88.     }
  89.    
  90.     echo "
  91.  
  92. <script language='Javascript'>
  93.  
  94.  
  95.    window.open(\"tabular.php\",\"tabular\",\"fullscreen,scrollbars\");
  96.  
  97.  
  98. </script>";
  99.  
  100.  
  101.  
  102.     //header("Location: " . $MM_redirectLoginSuccess );
  103.   }
  104.   else {
  105.     header("Location: ". $MM_redirectLoginFailed );
  106.   }
  107. }
  108. ?>
  109. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  110. <html xmlns="http://www.w3.org/1999/xhtml">
  111. <head>
  112. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  113. <title>Index</title>
  114. </head>
  115.  
  116. <body bgcolor="#FF9400">
  117. <form action="" method="POST">
  118. <center>
  119. <h1>Bienvenidos al proyecto de SEP Becas de Preparatoria</h1>
  120. <table width="550" border="1" bordercolor="#BF8330">
  121.   <tr>
  122.     <td colspan="2" bgcolor="#A66000"><div align="center">
  123.       <h2>Por favor escribe tu nombre y tu contraseña</h2>
  124.     </div></td>
  125.   </tr>
  126.   <tr>
  127.     <td>Teclea el folio</td>
  128.     <td><label>
  129.     <input name="Nombre" type="text" id="Nombre" size="9" maxlength="9" onkeyup = "this.value=this.value.toUpperCase();" />
  130.     </label></td>
  131.   </tr>
  132.   <tr>
  133.     <td colspan="2"><div align="center">
  134.       <input type="submit" name="Entrar" id="Entrar" value="Entrar a Capturar" />
  135.     </div></td>
  136.   </tr>
  137. </table>
  138. </center>
  139. </form>
  140. </body>
  141. </html>