Foros del Web » Programando para Internet » PHP »

PHP OO Alguien me puede explicar porque no va a la funcion guardar()

Estas en el tema de Alguien me puede explicar porque no va a la funcion guardar() en el foro de PHP en Foros del Web. Este es el código, presiono el botón guardar y no hace nada, no se redirecciona a guardar() @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código PHP: Ver original echo("<br>"); echo("<form ...
  #1 (permalink)  
Antiguo 06/05/2015, 08:50
 
Fecha de Ingreso: abril-2015
Ubicación: Santiago de Chile
Mensajes: 80
Antigüedad: 9 años
Puntos: 0
Información Alguien me puede explicar porque no va a la funcion guardar()

Este es el código, presiono el botón guardar y no hace nada, no se redirecciona a guardar()

Código PHP:
Ver original
  1. echo("<br>");
  2. echo("<form method=POST name=datos_ingreso>");
  3. echo("<input type=hidden value=".$_POST["usuario"]." name=num_actual>");
  4. echo("<table border=1 width=100%>");
  5. echo("<tr>");
  6. echo("</tr>");
  7. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Datos de Usuario</span></td>");
  8. echo("</tr>");
  9.  
  10. echo("<table border=1 width=100%>");
  11. echo("<tr>");
  12. echo("</tr>");
  13. echo("  <td>Nombre Completo</td>");
  14. echo("  <td><input type=text value=".chr(34).$nombre_largo.chr(34)." name=nombre_largo size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  15. echo("</tr>");
  16. echo("<tr>");
  17. echo("  <td>Sucursal</td>");
  18. echo("  <td>");
  19. echo("  <select name=sucursal onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
  20. $result = mysql_query("SELECT * FROM mae_ubicaciones WHERE sucursal ='S' order by Ubicacion");
  21. if (mysql_num_rows($result)>0){
  22.    $i=0;
  23.    $rows=mysql_num_rows($result);
  24.    while($i < $rows) {
  25.       if ($sucursal==mysql_result($result, $i, "Ubicacion")){
  26.         echo("<option selected value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
  27.         }else{
  28.         echo("<option value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
  29.         }
  30.    $i++;
  31.    }
  32. }
  33. echo("</select>");
  34. echo("  </td>");
  35. echo("</tr>");
  36. echo("<tr>");
  37. echo("  <td>Contrase&ntilde;a</td>");
  38. echo("  <td><input type=text value=".chr(34).$pass.chr(34)." name=clave size=10 maxlength=10 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  39. echo("</tr>");
  40. echo("<tr>");
  41. echo("  <td>Area de trabajo (Marcada con ''X'')</td>");
  42. echo("  <td>Camiones Usados      <input type=text value=".chr(3).$c_usados.chr(3)." name=c_usados size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  43. echo("</tr>");
  44. echo("<tr>");
  45. echo("  <td></td>");
  46. echo("  <td>Camiones Ford Nuevos <input type=text value=".chr(3).$c_ford_nuevos.chr(3)." name=c_ford_nuevos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  47. echo("</tr>");
  48. echo("  <td></td>");
  49. echo("  <td>Hyundai              <input type=text value=".chr(3).$Hyundai.chr(3)." name=Hyundai size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  50. echo("</tr>");
  51. echo("  <td></td>");
  52. echo("  <td>Global               <input type=text value=".chr(3).$global.chr(3)." name=global size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  53. echo("</tr>");
  54. echo("  <td></td>");
  55. echo("  <td>Utilitarios Livianos <input type=text value=".chr(3).$u_livianos.chr(3)." name=u_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  56. echo("</tr>");
  57. echo("  <td></td>");
  58. echo("  <td>Ford Livianos        <input type=text value=".chr(3).$ford_livianos.chr(3)." name=ford_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  59. echo("</tr>");
  60. echo("  <td></td>");
  61. echo("  <td>Fortaleza            <input type=text value=".chr(3).$fortaleza.chr(3)." name=Fortaleza size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  62. echo("</tr>");
  63. echo("  <td></td>");
  64. echo("  <td>Fortaleza Camiones   <input type=text value=".chr(3).$fortaleza_camiones.chr(3)." name=fortaleza_camiones size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  65. echo("</tr>");
  66. echo("  <td></td>");
  67. echo("  <td>Motos                <input type=text value=".chr(3).$motos.chr(3)." name=motos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  68. echo("</tr>");
  69. echo("  <td></td>");
  70. echo("  <td>Rentacar             <input type=text value=".chr(3).$rentacar.chr(3)." name=Rentacar size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  71. echo("</tr>");
  72. echo("  <td></td>");
  73. echo("  <td>Agricola             <input type=text value=".chr(3).$agricola.chr(3)." name=agricola size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  74. echo("</tr>");
  75. echo("  <td></td>");
  76. echo("  <td>Sin Area             <input type=text value=".chr(3).$sin_area.chr(3)." name=sin_area size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  77. echo("</tr>");
  78. echo("<tr>");
  79. echo("  <td>Fono</td>");
  80. echo("  <td><input type=text value=".chr(34).$fono_fijo.chr(34)."  name=fono_fijo size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  81. echo("</tr>");
  82.  
  83. echo("<tr>");
  84. echo("  <td>Nivel</td>");
  85. echo("  <td>");
  86. echo("  <select name=nivel onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
  87. if ($nivel==3){echo("<option selected value=3>Vendedor</option>");}else{echo("<option value=3>Vendedor</option>");}
  88. if ($nivel==2){echo("<option selected value=2>Asistente</option>");}else{echo("<option value=2>Asistente</option>");}
  89. if ($nivel==1){echo("<option selected value=1>Administrador</option>");}else{echo("<option value=1>Administrador</option>");}
  90. echo("</select>");
  91. echo("  </td>");
  92. echo("</tr>");
  93. echo("<tr>");
  94. echo("  <td>Cargo</td>");
  95. echo("  <td><input type=text value=".chr(34).$cargo.chr(34)."  name=cargo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  96. echo("</tr>");
  97. echo("<tr>");
  98. echo("  <td>Celular</td>");
  99. echo("  <td><input type=text value=".chr(34).$celular.chr(34)."  name=celular size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  100. echo("</tr>");
  101. $busqueda = 0;
  102. $cont=1;
  103. $busqueda = mysql_query("SELECT * FROM equipos_computacionales WHERE numero_unico=".$_POST["usuario"]);
  104. $Total=mysql_num_rows($busqueda);
  105. if (($busqueda)>0 and ($Total == 1)){
  106.     $ini=mysql_result($busqueda,0, "ini")+1;
  107.     $email=mysql_result($busqueda,0, "email");
  108.     $clave_correo=mysql_result($busqueda,0, "clave_correo");
  109.     $contrasena=mysql_result($busqueda,0,"contrasena");
  110.     $tipo_equipo=mysql_result($busqueda,0,"tipo_equipo");
  111.     $propietario=mysql_result($busqueda,0,"propietario");
  112.     $ip_equipo=mysql_result($busqueda,0,"ip_equipo");
  113.     $detalle=mysql_result($busqueda,0,"detalle");
  114.     $busqueda = 0;
  115.     $cont=$cont+1;
  116. }
  117. if ($Total==0){
  118.     $ini="1";
  119.     $email="";
  120.     $clave_correo="";
  121.     $contrasena="";
  122.     $tipo_equipo="";
  123.     $propietario="";
  124.     $detalle="";
  125.     $ip_equipo="";
  126.     $detalle="";
  127. }
  128.  
  129. echo("<table border=1 width=100%>");
  130. echo("<br>");
  131. echo("<tr>");
  132. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Claves del Sistema</span></td>");
  133. echo("</tr>");
  134.  
  135. echo("<table border=1 width=100%>");
  136. echo("<tr>");
  137. echo("</tr>");
  138. echo("  <td>e-Mail</td>");
  139. echo("  <td><input type=text value=".chr(34).$email.chr(34)." name=email size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  140. echo("</tr>");
  141. echo("  <td>Clave Correo</td>");
  142. echo(" <td><input type=text value=".chr(34).$clave_correo.chr(34)."  name=clave_correo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  143. echo("</tr>");
  144. echo("</table>");
  145.  
  146. echo("</tr>");
  147. echo("<table border=1 width=100%>");
  148. echo("<br>");
  149. echo("<tr>");
  150. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Plataforma</span></td>");
  151. echo("</tr>");
  152.  
  153. echo("<table border=1 width=100%>");
  154. echo("<tr>");
  155. echo("</tr>");
  156. echo("<tr>");
  157. echo("<td>Nombre de Usuario</td>");
  158. echo("  <td><input type=text value=".chr(34).$nombre_user.chr(34)."  name=nombre size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  159. echo("</tr>");
  160. echo("<tr>");
  161. echo("  <td>Contraseña</td>");
  162. echo("  <td><input type=text value=".chr(34).$contrasena.chr(34)."  name=contrasena size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  163. echo("</tr>");
  164. echo("<tr>");
  165. echo("  <td>Numero Unico</td>");
  166. echo(" <td><input type=text value=".chr(10).$num_unico.chr(10)."  name=num_unico size=30 maxlength=40 onkeypress=".chr(10)."return tabular(event,this)".chr(10)."></td>");
  167. echo("</tr>");
  168. echo("</table>");
  169.  
  170. echo("</tr>");
  171. echo("<table border=1 width=100%>");
  172. echo("<br>");
  173. echo("<tr>");
  174. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Equipos</span></td>");
  175. echo("</tr>");
  176.  
  177. echo("<table border=1 width=100%>");
  178. echo("<tr>");
  179. echo("</tr>");
  180. echo("<tr>");
  181. echo("<td>Seleccione el Tipo de Equipo</td>");
  182. echo("<td>");
  183. ?> <select name="$tipo_equipo" size="1">
  184. <option value="PC" selected>PC</option>
  185. <option value="NOTEBOOK">Notebook</option>
  186. <option value="PANTALLA">Pantalla</option>
  187. </select>
  188. <?
  189. echo("</td>");
  190. echo("<tr>");
  191. echo("<tr>");
  192. echo("  <td>IP</td>");
  193. echo(" <td><input type=text value=".chr(34).$ip_equipo.chr(34)."  name=ip_equipo size=15 maxlength=15 onkeypress=".chr(15)."return tabular(event,this)".chr(15)."></td>");
  194. echo("</tr>");
  195. echo("<tr>");
  196. echo("<tr>");
  197. echo("  <td>Propiedad de:</td>");
  198. echo("<td>");
  199. ?> <select name="$propiedad" size="1">
  200. <option value="Curifor" selected>Curifor</option>
  201. <option value="Personal">Personal</option>
  202. </select>
  203. <?
  204. echo("</td>");
  205.  
  206. echo("<tr>");
  207. echo("  <td valign='top'>Detalles</td>");
  208. echo(" <td> "); ?>
  209. <textarea name="$detalle" rows="100" cols="100" enabled><? echo $detalle; ?>
  210. </textarea>
  211. <? echo "</td>";
  212. echo "</tr>";
  213. echo("</table>");
  214.  
  215. echo("<tr>");
  216. echo("<br>");
  217. echo("<table border=1 width=100%>");
  218. echo("<tr>");
  219. echo("<table border=1 width=100%>");
  220. ?>
  221. <input type="button" value="Guardar" onclick="guardar()">
  222. </form>
  223. <?
  224. }
  225. ?>
  226.  
  227. </div>
  228. </body>
  229. </html>
  #2 (permalink)  
Antiguo 06/05/2015, 08:52
 
Fecha de Ingreso: abril-2015
Ubicación: Santiago de Chile
Mensajes: 80
Antigüedad: 9 años
Puntos: 0
Respuesta: Alguien me puede explicar porque no va a la funcion guardar()

Código PHP:
Ver original
  1. function guardar(){
  2. var envio="";
  3. envio=envio +"numero_unico=" + datos_ingreso.numero_unico.value +"&"
  4. envio=envio +"nombre_usuario=" + datos_ingreso.nombre_usuario.value +"&"
  5. envio=envio +"contrasena=" + datos_ingreso.contrasena.value +"&"
  6. envio=envio +"tipo_equipo=" + datos_ingreso.tipo_equipo.value +"&"
  7. envio=envio +"ip_equipo=" + datos_ingreso.ip_equipo.value +"&"
  8. envio=envio +"propietario=" + datos_ingreso.propietario.value +"&"
  9. envio=envio +"email=" + datos_ingreso.email.value +"&"
  10. envio=envio +"clave_correo=" + datos_ingreso.clave_correo.value +"&"
  11. envio=envio +"detalle=" + datos_ingreso.detalle.value +"&"
  12. window.location.href="guarda_equipos.php?"+envio;
  13. }

Última edición por rudiaz; 06/05/2015 a las 12:03
  #3 (permalink)  
Antiguo 06/05/2015, 12:16
 
Fecha de Ingreso: abril-2015
Ubicación: Santiago de Chile
Mensajes: 80
Antigüedad: 9 años
Puntos: 0
Respuesta: Alguien me puede explicar porque no va a la funcion guardar()

Aca va en dos tandas el programa:

Código PHP:
Ver original
  1. <?
  2. ?>
  3. <?
  4. include "conectar.php";
  5. ?>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  7.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8.  
  9. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  10.  
  11. <script language="JavaScript">
  12. function tabular(e,obj) {
  13.   tecla=(document.all) ? e.keyCode : e.which;
  14.   if(tecla!=13) return;
  15.   frm=obj.form;
  16.   for(i=0;i<frm.elements.length;i++)
  17.     if(frm.elements[i]==obj) {
  18.       if (i==frm.elements.length-1) i=-1;
  19.       break }
  20.   frm.elements[i+1].focus();
  21.   return false;
  22. }
  23. function tabular2(e,obj) {
  24.   tecla=(document.all) ? e.keyCode : e.which;
  25.   if (tecla>13 && tecla < 48){return false;}
  26.   if (tecla>57){return false;}
  27.   if(tecla!=13) return;
  28.   frm=obj.form;
  29.   for(i=0;i<frm.elements.length;i++)
  30.     if(frm.elements[i]==obj) {
  31.       if (i==frm.elements.length-1) i=-1;
  32.       break }
  33.   frm.elements[i+1].focus();
  34.   return false;
  35. }
  36. function guardar(){
  37. var envio="";
  38. envio=envio +"numero_unico=" + datos_ingreso.numero_unico.value +"&"
  39. envio=envio +"nombre_usuario=" + datos_ingreso.nombre_usuario.value +"&"
  40. envio=envio +"contrasena=" + datos_ingreso.contrasena.value +"&"
  41. envio=envio +"tipo_equipo=" + datos_ingreso.tipo_equipo.value +"&"
  42. envio=envio +"ip_equipo=" + datos_ingreso.ip_equipo.value +"&"
  43. envio=envio +"propietario=" + datos_ingreso.propietario.value +"&"
  44. envio=envio +"email=" + datos_ingreso.email.value +"&"
  45. envio=envio +"clave_correo=" + datos_ingreso.clave_correo.value +"&"
  46. envio=envio +"detalle=" + datos_ingreso.detalle.value +"&"
  47. window.location.href="guarda_equipos.php?"+envio;
  48. }
  49. </script>
  50.   <head>
  51.  
  52.     <title>Ingreso de Equipos</title>
  53.  
  54.     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  55. <!--
  56. .Estilo1 {
  57.     font-size: 18px;
  58.     color: #FFFFFF;
  59. }
  60. .Estilo3 {color: #FFFFFF}
  61. .Estilo4 {
  62.     font-size: 16px;
  63.     color: #FFFFFF;
  64. }
  65. -->
  66.     </style>
  67.     <style type="text/css">
  68. <!--
  69. .Estilo4 {font-size: 36px}
  70. .Estilo5 {font-size: 18px}
  71. .Estilo6 {font-size: 24px}
  72. -->
  73.     </style>
  74. </head>
  75.   <body>
  76.   <p>
  77.     <?
  78. /* include "encabezado.php"; */
  79. ?>
  80.   </p>
  81.   <table border="0">
  82.     <tr>
  83.       <th scope="col"><img src="imagenes/logoinformatica.jpg" width="182" height="53" /></th>
  84.       <th scope="col"><span class="Estilo3 Estilo4">&quot;Ingreso de Equipos&quot;</span></th>
  85.     </tr>
  86.   </table>
  87.   <p><br>
  88.     <br>
  89. </p>
  90.   <div class="content">
  91.     <form method="POST" name="form1" action="ingreso_stock.php">
  92. <table border="1" width="100%">
  93. <tr>
  94.   <td colspan="2" bgcolor="#00FFFF"><span class="Estilo1 Estilo6">Usuario</span></td>
  95.   </tr>
  96. <tr>
  97.   <td bgcolor="#00FFFF"><span class="Estilo5">Seleccione el usuario
  98.    
  99.   </span></td>
  100.   <td bgcolor="#00FFFF">
  101.   <select name="usuario" onkeypress="return tabular(event,this)">
  102. <? //por área
  103. $result = mysql_query("SELECT * FROM usuarios  WHERE  vigente ='S' order by nombre_largo");
  104. if (mysql_num_rows($result)>0){
  105.    $i=0;
  106.    $rows=mysql_num_rows($result);
  107.    while($i < $rows) {
  108.    
  109.       if ($_POST["usuario"]==mysql_result($result, $i, "num_unico")){
  110.         echo("<option selected value=".mysql_result($result, $i, "num_unico").">".mysql_result($result, $i, "nombre_largo")."</option>");
  111.         }else{
  112.         echo("<option value=".mysql_result($result, $i, "num_unico").">".mysql_result($result, $i, "nombre_largo")."</option>");
  113.         }
  114.    $i++;
  115.    }
  116. }
  117. ?>
  118. </select></td>
  119. </tr>
  120. </table>
  121. <input type="submit" value="Mostrar">
  122. </form>
  123.  
  124. <?
  125. if ($_POST["usuario"]!=""){
  126. //selecciona usuario a modificar
  127. $result = mysql_query("SELECT * FROM usuarios WHERE num_unico=".$_POST["usuario"]);
  128. if (mysql_num_rows($result)>0){
  129.     $nombre_largo=mysql_result($result,0, "Nombre_largo");
  130.     $sucursal=mysql_result($result,0, "Sucursal");
  131.     $c_usados=mysql_result($result,0,"c_usados");
  132.     $c_ford_nuevos=mysql_result($result,0,"c_ford_nuevos");
  133.     $hyundai=mysql_result($result,0,"Hyundai");
  134.     $global=mysql_result($result,0,"Global");
  135.     $u_livianos=mysql_result($result,0,"u_livianos");
  136.     $ford_livianos=mysql_result($result,0,"ford_livianos");
  137.     $fortaleza=mysql_result($result,0,"fortaleza");
  138.     $fortaleza_camiones=mysql_result($result,0,"fortaleza_camiones");
  139.     $motos=mysql_result($result,0,"Motos");
  140.     $rentacar=mysql_result($result,0,"rentacar");
  141.     $agricola=mysql_result($result,0,"agricola");
  142.     $sin_area=mysql_result($result,0,"sin_area");
  143.     $nombre_user=mysql_result($result,0, "Nombre_Usuario");
  144.     $pass=mysql_result($result,0, "Clave_ing");
  145.     $nivel=mysql_result($result,0, "Nivel");
  146.     $cargo=mysql_result($result,0, "cargo_coti");
  147.     $celular=mysql_result($result,0, "celular_coti");
  148.     $email=mysql_result($result,0, "email");
  149.     $num_unico=mysql_result($result,0, "num_unico");
  150.     $fono_fijo=mysql_result($result,0, "Fono_Fijo");
  151. }
  152. echo("<br>");
  153. echo("<form method=POST name=datos_ingreso>");
  154. echo("<input type=hidden value=".$_POST["usuario"]." name=num_actual>");
  155. echo("<table border=1 width=100%>");
  156. echo("<tr>");
  157. echo("</tr>");
  158. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Datos de Usuario</span></td>");
  159. echo("</tr>");
  160.  
  161. echo("<table border=1 width=100%>");
  162. echo("<tr>");
  163. echo("</tr>");
  164. echo("  <td>Nombre Completo</td>");
  165. echo("  <td><input type=text value=".chr(34).$nombre_largo.chr(34)." name=nombre_largo size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  166. echo("</tr>");
  167. echo("<tr>");
  168. echo("  <td>Sucursal</td>");
  169. echo("  <td>");
  170. echo("  <select name=sucursal onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
  171. $result = mysql_query("SELECT * FROM mae_ubicaciones WHERE sucursal ='S' order by Ubicacion");
  172. if (mysql_num_rows($result)>0){
  173.    $i=0;
  174.    $rows=mysql_num_rows($result);
  175.    while($i < $rows) {
  176.       if ($sucursal==mysql_result($result, $i, "Ubicacion")){
  177.         echo("<option selected value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
  178.         }else{
  179.         echo("<option value=".chr(34).mysql_result($result, $i, "Ubicacion").chr(34).">".mysql_result($result, $i, "Ubicacion")."</option>");
  180.         }
  181.    $i++;
  182.    }
  183. }
  184. echo("</select>");
  185. echo("  </td>");
  186. echo("</tr>");
  187. echo("<tr>");
  188. echo("  <td>Contrase&ntilde;a</td>");
  189. echo("  <td><input type=text value=".chr(34).$pass.chr(34)." name=clave size=10 maxlength=10 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  #4 (permalink)  
Antiguo 06/05/2015, 12:17
 
Fecha de Ingreso: abril-2015
Ubicación: Santiago de Chile
Mensajes: 80
Antigüedad: 9 años
Puntos: 0
Respuesta: Alguien me puede explicar porque no va a la funcion guardar()

Segunda tanda:

Código PHP:
Ver original
  1. echo("</tr>");
  2. echo("<tr>");
  3. echo("  <td>Area de trabajo (Marcada con ''X'')</td>");
  4. echo("  <td>Camiones Usados      <input type=text value=".chr(3).$c_usados.chr(3)." name=c_usados size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  5. echo("</tr>");
  6. echo("<tr>");
  7. echo("  <td></td>");
  8. echo("  <td>Camiones Ford Nuevos <input type=text value=".chr(3).$c_ford_nuevos.chr(3)." name=c_ford_nuevos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  9. echo("</tr>");
  10. echo("  <td></td>");
  11. echo("  <td>Hyundai              <input type=text value=".chr(3).$Hyundai.chr(3)." name=Hyundai size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  12. echo("</tr>");
  13. echo("  <td></td>");
  14. echo("  <td>Global               <input type=text value=".chr(3).$global.chr(3)." name=global size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  15. echo("</tr>");
  16. echo("  <td></td>");
  17. echo("  <td>Utilitarios Livianos <input type=text value=".chr(3).$u_livianos.chr(3)." name=u_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  18. echo("</tr>");
  19. echo("  <td></td>");
  20. echo("  <td>Ford Livianos        <input type=text value=".chr(3).$ford_livianos.chr(3)." name=ford_livianos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  21. echo("</tr>");
  22. echo("  <td></td>");
  23. echo("  <td>Fortaleza            <input type=text value=".chr(3).$fortaleza.chr(3)." name=Fortaleza size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  24. echo("</tr>");
  25. echo("  <td></td>");
  26. echo("  <td>Fortaleza Camiones   <input type=text value=".chr(3).$fortaleza_camiones.chr(3)." name=fortaleza_camiones size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  27. echo("</tr>");
  28. echo("  <td></td>");
  29. echo("  <td>Motos                <input type=text value=".chr(3).$motos.chr(3)." name=motos size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  30. echo("</tr>");
  31. echo("  <td></td>");
  32. echo("  <td>Rentacar             <input type=text value=".chr(3).$rentacar.chr(3)." name=Rentacar size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  33. echo("</tr>");
  34. echo("  <td></td>");
  35. echo("  <td>Agricola             <input type=text value=".chr(3).$agricola.chr(3)." name=agricola size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  36. echo("</tr>");
  37. echo("  <td></td>");
  38. echo("  <td>Sin Area             <input type=text value=".chr(3).$sin_area.chr(3)." name=sin_area size=1 maxlength=1 onkeypress=".chr(3)."return tabular(event,this)".chr(3)."></td>");
  39. echo("</tr>");
  40. echo("<tr>");
  41. echo("  <td>Fono</td>");
  42. echo("  <td><input type=text value=".chr(34).$fono_fijo.chr(34)."  name=fono_fijo size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  43. echo("</tr>");
  44.  
  45. echo("<tr>");
  46. echo("  <td>Nivel</td>");
  47. echo("  <td>");
  48. echo("  <select name=nivel onkeypress=".chr(34)."return tabular(event,this)".chr(34).">");
  49. if ($nivel==3){echo("<option selected value=3>Vendedor</option>");}else{echo("<option value=3>Vendedor</option>");}
  50. if ($nivel==2){echo("<option selected value=2>Asistente</option>");}else{echo("<option value=2>Asistente</option>");}
  51. if ($nivel==1){echo("<option selected value=1>Administrador</option>");}else{echo("<option value=1>Administrador</option>");}
  52. echo("</select>");
  53. echo("  </td>");
  54. echo("</tr>");
  55. echo("<tr>");
  56. echo("  <td>Cargo</td>");
  57. echo("  <td><input type=text value=".chr(34).$cargo.chr(34)."  name=cargo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  58. echo("</tr>");
  59. echo("<tr>");
  60. echo("  <td>Celular</td>");
  61. echo("  <td><input type=text value=".chr(34).$celular.chr(34)."  name=celular size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  62. echo("</tr>");
  63. $busqueda = 0;
  64. $cont=1;
  65. $busqueda = mysql_query("SELECT * FROM equipos_computacionales WHERE numero_unico=".$_POST["usuario"]);
  66. $Total=mysql_num_rows($busqueda);
  67. if (($busqueda)>0 and ($Total == 1)){
  68.     $ini=mysql_result($busqueda,0, "ini")+1;
  69.     $email=mysql_result($busqueda,0, "email");
  70.     $clave_correo=mysql_result($busqueda,0, "clave_correo");
  71.     $contrasena=mysql_result($busqueda,0,"contrasena");
  72.     $tipo_equipo=mysql_result($busqueda,0,"tipo_equipo");
  73.     $propietario=mysql_result($busqueda,0,"propietario");
  74.     $ip_equipo=mysql_result($busqueda,0,"ip_equipo");
  75.     $detalle=mysql_result($busqueda,0,"detalle");
  76.     $busqueda = 0;
  77.     $cont=$cont+1;
  78. }
  79. if ($Total==0){
  80.     $ini="1";
  81.     $email="";
  82.     $clave_correo="";
  83.     $contrasena="";
  84.     $tipo_equipo="";
  85.     $propietario="";
  86.     $detalle="";
  87.     $ip_equipo="";
  88.     $detalle="";
  89. }
  90.  
  91. echo("<table border=1 width=100%>");
  92. echo("<br>");
  93. echo("<tr>");
  94. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Claves del Sistema</span></td>");
  95. echo("</tr>");
  96.  
  97. echo("<table border=1 width=100%>");
  98. echo("<tr>");
  99. echo("</tr>");
  100. echo("  <td>e-Mail</td>");
  101. echo("  <td><input type=text value=".chr(34).$email.chr(34)." name=email size=20 maxlength=20 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  102. echo("</tr>");
  103. echo("  <td>Clave Correo</td>");
  104. echo(" <td><input type=text value=".chr(34).$clave_correo.chr(34)."  name=clave_correo size=30 maxlength=40 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  105. echo("</tr>");
  106. echo("</table>");
  107.  
  108. echo("</tr>");
  109. echo("<table border=1 width=100%>");
  110. echo("<br>");
  111. echo("<tr>");
  112. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Plataforma</span></td>");
  113. echo("</tr>");
  114.  
  115. echo("<table border=1 width=100%>");
  116. echo("<tr>");
  117. echo("</tr>");
  118. echo("<tr>");
  119. echo("<td>Nombre de Usuario</td>");
  120. echo("  <td><input type=text value=".chr(34).$nombre_user.chr(34)."  name=nombre size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  121. echo("</tr>");
  122. echo("<tr>");
  123. echo("  <td>Contraseña</td>");
  124. echo("  <td><input type=text value=".chr(34).$contrasena.chr(34)."  name=contrasena size=12 maxlength=12 onkeypress=".chr(34)."return tabular(event,this)".chr(34)."></td>");
  125. echo("</tr>");
  126. echo("<tr>");
  127. echo("  <td>Numero Unico</td>");
  128. echo(" <td><input type=text value=".chr(10).$num_unico.chr(10)."  name=num_unico size=30 maxlength=40 onkeypress=".chr(10)."return tabular(event,this)".chr(10)."></td>");
  129. echo("</tr>");
  130. echo("</table>");
  131.  
  132. echo("</tr>");
  133. echo("<table border=1 width=100%>");
  134. echo("<br>");
  135. echo("<tr>");
  136. echo("<td colspan='2' bgcolor='#00FFFF'><span class='Estilo1 Estilo6'>Equipos</span></td>");
  137. echo("</tr>");
  138.  
  139. echo("<table border=1 width=100%>");
  140. echo("<tr>");
  141. echo("</tr>");
  142. echo("<tr>");
  143. echo("<td>Seleccione el Tipo de Equipo</td>");
  144. echo("<td>");
  145. ?> <select name="$tipo_equipo" size="1">
  146. <option value="PC" selected>PC</option>
  147. <option value="NOTEBOOK">Notebook</option>
  148. <option value="PANTALLA">Pantalla</option>
  149. </select>
  150. <?
  151. echo("</td>");
  152. echo("<tr>");
  153. echo("<tr>");
  154. echo("  <td>IP</td>");
  155. echo(" <td><input type=text value=".chr(34).$ip_equipo.chr(34)."  name=ip_equipo size=15 maxlength=15 onkeypress=".chr(15)."return tabular(event,this)".chr(15)."></td>");
  156. echo("</tr>");
  157. echo("<tr>");
  158. echo("<tr>");
  159. echo("  <td>Propiedad de:</td>");
  160. echo("<td>");
  161. ?> <select name="$propiedad" size="1">
  162. <option value="Curifor" selected>Curifor</option>
  163. <option value="Personal">Personal</option>
  164. </select>
  165. <?
  166. echo("</td>");
  167.  
  168. echo("<tr>");
  169. echo("  <td valign='top'>Detalles</td>");
  170. echo(" <td> "); ?>
  171. <textarea name="$detalle" rows="100" cols="100" enabled><? echo $detalle; ?>
  172. </textarea>
  173. <? echo "</td>";
  174. echo "</tr>";
  175. echo("</table>");
  176.  
  177. echo("<tr>");
  178. echo("<br>");
  179. echo("<table border=1 width=100%>");
  180. echo("<tr>");
  181. echo("<table border=1 width=100%>");
  182. ?>
  183. <input type="button" value="Guardar" onclick="guardar()">
  184. </form>
  185. <?
  186. }
  187. ?>
  188.  
  189. </div>
  190. </body>
  191. </html>

Etiquetas: funcion, html, mysql, select, sql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:18.