SHARE
TWEET

Untitled

a guest Jun 18th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Registro de datos</title>
  5.  
  6. </head>
  7.  
  8. <body>
  9.      <?php
  10.     include("conexion2.php");
  11.     $Id = $_REQUEST['Id'];
  12.  
  13.     $query = "SELECT * FROM tabla_imagen WHERE Id ='$Id'";
  14.     $resultado= $conexion->query($query);
  15.     $row = $resultado->fetch_assoc();
  16.     ?>
  17.     <center>
  18.  
  19.     <form action="modificarh.php?id=<?php echo $row['Id']; ?>" method="post"  enctype="multipart/form-data">
  20.  
  21.  <input type="text" REQUIRED name="nombre" placeholder="Nombre..." value="<?
  22.   php echo $row['nombre'];?>"/><br/><br/>            
  23.                 <input type="submit" value="Guardar" >  
  24.                 </form>
  25.              </center>
  26.     </body>
  27.     </html>
  28.      
  29. <?php
  30.  
  31. include ("conexion2.php");
  32.  
  33. $Id = $_REQUEST['Id'];
  34.  
  35. $nombre = $_POST['nombre'];
  36.  
  37. $query = "UPDATE tabla_imagen SET nombre='$nombre' WHERE Id = '$Id'";
  38. $resultado = $conexion->query($query);
  39.  
  40. if($resultado){
  41.  
  42.  
  43.     header("Location: index.php");
  44. }
  45. else{
  46.     echo "No se modiifico";
  47. }
  48.  
  49. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top