Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/03/2015, 20:05
darioPHP
 
Fecha de Ingreso: marzo-2015
Mensajes: 15
Antigüedad: 9 años, 2 meses
Puntos: 3
Busqueda Respuesta: variable no responde a WHERE

Una forma practica para no ondar demasiado es usar Jquery.
agrega como primer script el CDN que ofrece Google:
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.    <head>
  3.       <!-- title, metadatos, css, etc -->
  4.       <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
  5.       <!-- otros scripts, etc. -->
  6.    </head>
  7.    <body>
  8.    </body>
  9. </html>

Luego agregas tu script algo asi
Código Javascript:
Ver original
  1. <script>
  2.    var texto = document.getElementById(3).value;
  3.    $.get( "miArchivo.php", { texto_para_PHP : texto } );
  4. </script>

luego accedes a la variable desde "miArchivo.php" asi:

Código PHP:
Ver original
  1. <?php
  2.    $texto_para_mi_BD = $_GET["texto_para_PHP"];
  3. ?>

no lo testie, pero fijate si funciona.