Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <?php
  2. session_start();
  3. echo "Usted esta identificado como: ".$_SESSION['user_id']."<br>";
  4.  ?>
  5. <!DOCTYPE html>
  6. <!--
  7. To change this license header, choose License Headers in Project Properties.
  8. To change this template file, choose Tools | Templates
  9. and open the template in the editor.
  10. -->
  11. <html>
  12.     <head>
  13.         <meta charset="UTF-8">
  14.         <title></title>
  15.     </head>
  16.     <body>
  17.         <?php
  18.         $user=$_SESSION['user_id'];
  19.         $pass=$_SESSION['pass'];
  20.         echo "Usuario: ".$user." y ".$pass."<br>";
  21.         $servername = "localhost";
  22.         $dbname = "tarea";
  23.         $conn = mysqli_connect($servername, $user, $pass, $dbname);
  24.         if (!$conn) {
  25.             echo "No se pudo establecer la conexion con el servidor"."<br>";
  26.         }
  27.         $consulta = "SELECT * FROM origen where Nombre = '".$_POST['nombre_origen']."'";
  28.         $result = mysqli_query($conn,$consulta);
  29.         if (mysqli_num_rows($result)>0){
  30.             $Lugar_ID=$result['ID_lugar'];
  31.             $consulta=
  32.  
  33.         }
  34.  
  35.  
  36.         foreach ($result as $fila) {
  37.             echo "id: " . $fila["ID_Lugar"] . " El nombre: " . $fila["Nombre"] . "<br>";
  38.         }
  39.         ?>
  40.     </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement