fork download
  1. <?php
  2. $sUser = "";
  3. $sPass = "" ;
  4. $sPri = "" ;
  5.  
  6. if( isset( $_GET[ 'ingresar' ] ) ) {
  7. $sUser = $_GET['user'] ;
  8. $sPass = $_GET['pass'] ;
  9.  
  10. $iServidor = mysql_connect( "desarrollo.is.escuelaing.edu.co","bdsppc","sppc20121" ) ;
  11. if( !$iServidor ) {
  12. $sPri = "problemas en la coneccion con el servidor";
  13. }
  14. else {
  15. $iBD = mysql_select_db( "bdsppc" );
  16. if( !$iBD ) {
  17. $sPri = 'MySQL Error: ' . mysql_error() ;
  18. }
  19. else {
  20. $sql = "select priusr from usuarios where codusr='$sUser' and pasusr='$sPass'" ;
  21.  
  22. $rta = mysql_query( $sql ) ;
  23. if( !$rta ) {
  24. $sPri = "ERROR: " . mysql_error() ;
  25. }
  26. else {
  27. if( mysql_num_rows( $rta ) > 0 ) {
  28. $row = mysql_fetch_array( $rta );
  29. $sPri = $row[ 'priusr' ];
  30.  
  31. header("Location: fSPPCMenu.php?");
  32. }
  33. else {
  34. $sPri = "USUARIO NO EXISTE" ;
  35. }
  36. }
  37. }
  38. }
  39. }
  40.  
  41. ?>
  42.  
  43. <html>
  44. <head>
  45. <title>Ingreso de usuarios al sistema</title>
  46. </head>
  47.  
  48. <center>
  49.  
  50. <BODY BACKGROUND="Image4.gif" link="#000080" vlink="#000080" onLoad="document.forms[0].elements[0].focus()">
  51. <H1>
  52. <DIV id="titulo">
  53. <font color=blue size=7>S P P C - 1</font>
  54. </DIV>
  55. </H1>
  56. <H4>S P P C - 1</H4>
  57.  
  58. <HR>
  59. </BODY>
  60.  
  61. <FORM METHOD="get">
  62. <table summary="DescripciĆ³n de la tabla y su contenido" id="miTabla" border=1>
  63. <caption>Administracion de usuarios</caption>
  64. <thead>
  65. <tr>
  66. <th scope="col">Usuario</th>
  67. <th scope="col">Clave</th>
  68. </tr>
  69. </thead>
  70. <tbody>
  71. <tr>
  72. <td><input type="text" name="user" id="user" value="<?php echo $sUser ?>" /></td>
  73. <td><input type="text" name="pass" id="pass" value="<?php echo $sPass ?>" /></td>
  74. </tr>
  75. <td colspan=2><input type="text" name="priv" value="<?php echo $sPri ?>" disabled="true" /></td>
  76. </tr>
  77. </tbody>
  78. <tfoot>
  79. <tr>
  80. <th scope="col">
  81. <div><input type="submit" name="ingresar" value="ingresar" /></div>
  82. </th>
  83. <th scope="col">
  84. <div><input type="reset" value="Limpiar" /></div>
  85. </th>
  86. </tr>
  87. </tfoot>
  88. </table>
  89. </form>
  90. </center>
  91. </html>
Success #stdin #stdout 0.03s 25380KB
stdin
Standard input is empty
stdout
<html>
   <head>
      <title>Ingreso de usuarios al sistema</title>
   </head>

   <center>

   <BODY BACKGROUND="Image4.gif" link="#000080" vlink="#000080" onLoad="document.forms[0].elements[0].focus()">
      <H1>
         <DIV id="titulo">
            <font color=blue size=7>S P P C - 1</font>
         </DIV>
      </H1>
      <H4>S P P C - 1</H4>

      <HR>
   </BODY>

   <FORM METHOD="get">
      <table summary="Descripción de la tabla y su contenido" id="miTabla" border=1>
            <caption>Administracion de usuarios</caption>
            <thead>
               <tr>
                  <th scope="col">Usuario</th>
                  <th scope="col">Clave</th>
               </tr>
            </thead>
            <tbody>
               <tr>
                  <td><input type="text" name="user" id="user" value="" /></td>
                  <td><input type="text" name="pass" id="pass" value="" /></td>
               </tr>
				      <td colspan=2><input type="text" name="priv" value="" disabled="true" /></td>
               </tr>
            </tbody>
            <tfoot>
               <tr>
                  <th scope="col">
                     <div><input type="submit" name="ingresar" value="ingresar" /></div>
                  </th>
                  <th scope="col">
                     <div><input type="reset" value="Limpiar" /></div>
                  </th>
               </tr>
            </tfoot>
         </table>
      </form>
      </center>
</html>