Ver Mensaje Individual
  #11 (permalink)  
Antiguo 09/02/2012, 19:15
bartman742
 
Fecha de Ingreso: enero-2012
Mensajes: 64
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: convertir informacion de un input en variable php

ahora el problema viene aqui, este es el codigo de untitled1.php

Código PHP:
Ver original
  1. <?php
  2. require('./config.php');
  3.  
  4. ?>
  5. <script type="text/javascript" charset="utf-8">
  6.  
  7. function data1(){
  8. parent.document.getElementById('vb1').innerHTML="<font size='1' color='blue'>"+document.getElementById('vv1').value+"</font>";
  9. parent.document.getElementById('vb2').innerHTML="<font size='-1' color='white'><strong>"+document.getElementById('vv2').value+"</strong></font>";
  10. parent.document.getElementById('vb5').innerHTML="<font size='1' color='blue'>"+document.getElementById('vv5').value+"</font>";
  11. parent.document.getElementById('vb9').innerHTML="<font size='1' color='blue'>"+document.getElementById('vv9').value+"</font>";
  12. parent.document.getElementById('vbserial').innerHTML="<font size='1' color='blue'>"+document.getElementById('vvserial').value+"</font>";
  13.  
  14.  
  15. parent.document.getElementById('v11').value=document.getElementById('vc1').value;
  16. parent.document.getElementById('v12').value=document.getElementById('vc2').value;
  17. parent.document.getElementById('v15').value=document.getElementById('vc5').value;
  18. parent.document.getElementById('v19').value=document.getElementById('vc9').value;
  19. parent.document.getElementById('v1serial').value=document.getElementById('vcserial').value;
  20.  
  21. }
  22.  
  23. </script>
  24. <html>
  25.  
  26.  
  27.  
  28. <body bgcolor="#DEDEDE" onLoad="data1()">
  29. <div id="smoothmenu1" class="ddsmoothmenu">
  30. <ul>
  31. <?
  32. $v2 = trim($v2);
  33. $sqlarma2="select unique (c02iarea),c02_desc,c02_prioridad
  34.         from t07perarea,c02area,t01documento
  35.         where c02iarea=t07i_area
  36.         and c02_status='A'
  37.         and t07_status='A'
  38.         and t07i_perfil=$v9
  39.         and t01_area=c02iarea
  40.         and t01_status='A'
  41.         and t01_sistema=$v1
  42.         order by  c02_desc asc";
  43.         $resarma2= ifx_prepare($sqlarma2,$conecta,IFX_SCROLL); ifx_do($resarma2);
  44.         $indice1=$indice-1;
  45.  
  46.         while ($filaarma2=ifx_fetch_row($resarma2,"NEXT"))
  47.         {
  48.             echo "<li><a href='untitled2.php?
  49.                                             v1=$v1&
  50.                                             v2=$v2&
  51.                                             v5=$v5&
  52.                                             v2e=$filaarma2[c02iarea]&
  53.                                             v3=$filaarma2[c02_desc]&
  54.                                             v9=$v9&
  55.                                             vserial=$vserial' target='principal'><font size='1' face='Verdana'>".trim($filaarma2[c02_desc]). "</font></a></li>" ;
  56.             }
  57.            
  58. ?>
  59.  
  60. <?
  61. echo "<input type='hidden' id='vv1' value='$v1'>";
  62. echo "<input type='hidden' id='vv2' value='$v2'>";
  63. echo "<input type='hidden' id='vv5' value='$v5'>";
  64. echo "<input type='hidden' id='vv9' value='$v9'>";
  65. echo "<input type='hidden' id='vvserial' value='$vserial'>";
  66.  
  67. echo "<input type='hidden' id='vc1' value='$v1'>";
  68. echo "<input type='hidden' id='vc2' value='$v2'>";
  69. echo "<input type='hidden' id='vc5' value='$v5'>";
  70. echo "<input type='hidden' id='vc9' value='$v9'>";
  71. echo "<input type='hidden' id='vcserial' value='$vserial'>";
  72.  
  73. ?>
  74.  
  75. </ul>
  76. </div>
  77. </body>
  78. </html>

como veran, los resultados que arroja la consulta los almaceno en input de tipo hidden, y luego la funcion data1() en javascript envia esos resultados a esta parte del codigo del docvis.php

Código HTML:
Ver original
  1. <input type='text' id='v11' />
  2. <input type='text' id='v12' />
  3. <input type='text' id='v13a' />
  4. <input type='text' id='v15' />
  5. <input type='text' id='v12e' />
  6. <input type='text' id='v13' />
  7. <input type='text' id='v14' />
  8. <input type='text' id='v1serial' />
  9. <input type='text' id='v19' />
  10.  
  11. <div id = "vb1"></div>
  12.  
  13. <div id = "vb3a"></div>
  14. <div id = "vb5"></div>
  15. <div id = "vb2e"></div>
  16.  
  17.  
  18. <div id = "vbserial"></div>
  19. <div id = "vb9"></div>

lo que necesito es extraer el valor que estos input o div tienen para asignarlo a una variable php, habia pensado en algo como esto

Código PHP:
Ver original
  1. $v1 = "<script>document.getElementById('v11').value;</script>";

o en algo como esto

Código PHP:
Ver original
  1. $v1 = "<script>document.getElementById('vb1').value;</script>";

pero no funciona, me podrian ayudar, por favor cualquier sugerencia es buena, gracias