Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/05/2016, 13:03
Avatar de kip13
kip13
 
Fecha de Ingreso: agosto-2011
Mensajes: 167
Antigüedad: 12 años, 8 meses
Puntos: 13
Respuesta: Enviar valor desde html a archivo json.php

Debes enviar la variable al json.php desde el formulario:

enviar.html
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.  
  3. </head>
  4.  
  5.  
  6.  
  7. <!-- Cabecera -->
  8. <h1>Enviar</h1>
  9.  
  10. <!-- Contenido -->
  11.  
  12.  
  13. <form action="json.php" method="post" name="caja">
  14.  
  15. <input type="text" name="caja_texto" id="valor1" value=""/> <br />
  16.  
  17. <input type="submit" value="Seleccionar" />
  18. </form>
  19.  
  20.  
  21.  
  22. </body>
  23. </html>

Y al momento de recibirla seria asi:

json.php
Código PHP:
Ver original
  1. if(isset($_POST['caja_texto'])){
  2.         $caja = $_POST['caja_texto'];
  3.     }
  4.         echo $caja;

Entonces se almacenaría en la variable $caja el contenido enviado desde el formulario.