elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


  Mostrar Mensajes
Páginas: [1]
1  Programación / PHP / html y phpmyadmin en: 27 Julio 2017, 20:52 pm
Tengo un formulario en html que esta enlazado a una base de datos en phpmyadmin. Actualmente cualquiera puede entrar a la pagina y llenar el formulario sin necesidad de ingresar o registrarse, y los datos son almacenados en la base de datos. (la pagina es en wordpress)

Lo que necesito es que para que alguien pueda acceder al formulario, se registre e ingrese. Una ves haya diligenciado el formulario lo envié este se guarde, con la condición que en cualquier momento pueda entrar a ver los datos que diligencio y si es necesario modificarlos y al enviarlos se modifique la base de datos y no se cree un nuevo registro.

Adjunto codigo: bloqueado

Código:
<form action="php.php" enctype="multipart/form-data" method="post" onsubmit="return comprobar()"
name="formu" id="formu">
<table>
<tbody>
<tr>
<td style="text-align: center;" colspan="2"><span style="color: blue;"><strong>Datos del Ususario</strong>
</span></td>
</tr>
<tr>
<td align="right"><strong>Nombre de Usuario:</strong></td>
<td align="left"><input name="name" required="" type="text" placeholder="Usuario" /></td>
</tr>
<tr>
<td align="right"><strong>Ubicación:</strong></td>
<td align="left"><input name="ubicacion" required="" type="text" placeholder="Calle 00" /></td>
</tr>
<tr>
<td align="right"><strong>Potencia Total (MVA) :</strong></td>
<td align="left"><input max="50" min="0" name="pt" id="pt" required="" step="1" type="number" placeholder="100" /></td>
</tr>
<tr>
<td align="right"><strong>Potencia Gestionable (MVA):</strong></td>
<td align="left"><input max="50" min="0" name="pg" id="pg" required="" step="1" type="number" placeholder="100" /></td>
</tr>
<tr>
<td align="right"><strong>Potencia Máxima de Generación Distribuida (MVA):</strong></td>
<td align="left"><input max="20" min="0" name="gd" required="" step="1" type="number" placeholder="100" /></td>
</tr>
<tr>
<td style="text-align: center;" colspan="2"><span style="color: blue;"><strong>Disponibilidad de desconexión</strong></span>
<span style="font-size: small;">Maximo 6 participaciones por dia (1=disponible y 0=no disponible)</span></td>
</tr>
<tr>
<td align="right"><strong>Hora</strong></td>
<td align="left"><strong>Disponibiidad</strong></td>
</tr>
<tr>
<td align="right"><strong>00:00-01:00</strong></td>
<td align="left"><select name="h1" id="h1">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>01:00-02:00</strong></td>
<td align="left"><select name="h2" id="h2">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>02:00-03:00</strong></td>
<td align="left"><select name="h3" id="h3">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>03:00-04:00</strong></td>
<td align="left"><select name="h4" id="h4">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>04:00-05:00</strong></td>
<td align="left"><select name="h5" id="h5">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>05:00-06:00</strong></td>
<td align="left"><select name="h6" id="h6">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>06:00-07:00</strong></td>
<td align="left"><select name="h7" id="h7">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>07:00-08:00</strong></td>
<td align="left"><select name="h8" id="h8">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>08:00-09:00</strong></td>
<td align="left"><select name="h9" id="h9">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>09:00-10:00</strong></td>
<td align="left"><select name="h10" id="h10">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>10:00-11:00</strong></td>
<td align="left"><select name="h11" id="h11">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>11:00-12:00</strong></td>
<td align="left"><select name="h12" id="h12">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>12:00-13:00</strong></td>
<td align="left"><select name="h13" id="h13">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>13:00-14:00</strong></td>
<td align="left"><select name="h14" id="h14">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>14:00-15:00</strong></td>
<td align="left"><select name="h15" id="h15">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>15:00-16:00</strong></td>
<td align="left"><select name="h16" id="h16">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>16:00-17:00</strong></td>
<td align="left"><select name="h17" id="h17">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>17:00-18:00</strong></td>
<td align="left"><select name="h18" id="h18">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>18:00-19:00</strong></td>
<td align="left"><select name="h19" id="h19">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>19:00-20:00</strong></td>
<td align="left"><select name="h20" id="h20">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>20:00-21:00</strong></td>
<td align="left"><select name="h21" id="h21">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>21:00-22:00</strong></td>
<td align="left"><select name="h22" id="h22">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>22:00-23:00</strong></td>
<td align="left"><select name="h23" id="h23">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td align="right"><strong>23:00-00:00</strong></td>
<td align="left"><select name="h24" id="h24">
<option>1</option>
<option selected="selected">0</option>
</select></td>
</tr>
<tr>
<td style="text-align: center;" colspan="2"><span style="color: blue;"><strong>Costos por kVA</strong></span>
<span style="font-size: small;">Precio pactado por el ususario</span></td>
</tr>
<tr>
<td align="right"><strong>Franja A (00:00-06:00)</strong></td>
<td align="left"><select name="Ca">
<option>0,07</option>
<option>0,08</option>
<option>0,09</option>
<option>0,10</option>
<option>0,11</option>
<option>0,12</option>
<option>0,13</option>
<option>0,14</option>
<option>0,15</option>
<option>0,16</option>
<option selected="selected">0,17</option>
</select><strong>USD</strong></td>
</tr>
<tr>
<td align="right"><strong>Franja B (06:00-12:00)</strong></td>
<td align="left"><select name="Cb">
<option>0,07</option>
<option>0,08</option>
<option>0,09</option>
<option>0,10</option>
<option>0,11</option>
<option>0,12</option>
<option>0,13</option>
<option>0,14</option>
<option>0,15</option>
<option>0,16</option>
<option selected="selected">0,17</option>
</select><strong>USD</strong></td>
</tr>
<tr>
<td align="right"><strong>Franja C (12:00-18:00)</strong></td>
<td align="left"><select name="Cc">
<option>0,07</option>
<option>0,08</option>
<option>0,09</option>
<option>0,10</option>
<option>0,11</option>
<option>0,12</option>
<option>0,13</option>
<option>0,14</option>
<option>0,15</option>
<option>0,16</option>
<option selected="selected">0,17</option>
</select><strong>USD</strong></td>
</tr>
<tr>
<td align="right"><strong>Franja D (18:00-24:00)</strong></td>
<td align="left"><select name="Cd">
<option>0,07</option>
<option>0,08</option>
<option>0,09</option>
<option>0,10</option>
<option>0,11</option>
<option>0,12</option>
<option>0,13</option>
<option>0,14</option>
<option>0,15</option>
<option>0,16</option>
<option selected="selected">0,17</option>
</select><strong>USD</strong></td>
</tr>

</tbody>
</table>
<script type="text/javascript">//<![CDATA[
function comprobar()
{
   var pt = Number(document.getElementById('pt').value);
   var pg = Number(document.getElementById('pg').value);
   var h1 = Number(document.formu.h1.options[formu.h1.selectedIndex].value);
   var h2 = Number(document.formu.h2.options[formu.h2.selectedIndex].value);
   var h3 = Number(document.formu.h3.options[formu.h3.selectedIndex].value);
   var h4 = Number(document.formu.h4.options[formu.h4.selectedIndex].value);
   var h5 = Number(document.formu.h5.options[formu.h5.selectedIndex].value);
   var h6 = Number(document.formu.h6.options[formu.h6.selectedIndex].value);
   var h7 = Number(document.formu.h7.options[formu.h7.selectedIndex].value);
   var h8 = Number(document.formu.h8.options[formu.h8.selectedIndex].value);
   var h9 = Number(document.formu.h9.options[formu.h9.selectedIndex].value);
   var h10 = Number(document.formu.h10.options[formu.h10.selectedIndex].value);
   var h11 = Number(document.formu.h11.options[formu.h11.selectedIndex].value);
   var h12 = Number(document.formu.h12.options[formu.h12.selectedIndex].value);
   var h13 = Number(document.formu.h13.options[formu.h13.selectedIndex].value);
   var h14 = Number(document.formu.h14.options[formu.h14.selectedIndex].value);
   var h15 = Number(document.formu.h15.options[formu.h15.selectedIndex].value);
   var h16 = Number(document.formu.h16.options[formu.h16.selectedIndex].value);
   var h17 = Number(document.formu.h17.options[formu.h17.selectedIndex].value);
   var h18 = Number(document.formu.h18.options[formu.h18.selectedIndex].value);
   var h19 = Number(document.formu.h19.options[formu.h19.selectedIndex].value);
   var h20 = Number(document.formu.h20.options[formu.h20.selectedIndex].value);
   var h21 = Number(document.formu.h21.options[formu.h21.selectedIndex].value);
   var h22 = Number(document.formu.h22.options[formu.h22.selectedIndex].value);
   var h23 = Number(document.formu.h23.options[formu.h23.selectedIndex].value);
   var h24 = Number(document.formu.h24.options[formu.h24.selectedIndex].value);
   var suma = (h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21+h22+h23+h24);
   if (pt<pg)
   {
      alert("Potencia gestionable mayor a la potencia total");
      return false;
   }
  

  
if (suma>6)
   {
      alert("Horas de disponibilidad superiores al limite establecido");
      return false;
   }

   return true;
}
//]]></script>
<input type="submit"/>
</form>







· Prohibido publicar datos personales
· No se debe escribir en mayúsculas
>aquí las reglas del foro
-Engel Lex
2  Programación / Desarrollo Web / Duda al crear una encuesta en: 21 Julio 2017, 21:30 pm
Cordial saludo, alguien me puede ayudar con esto. Cree un formulario en en contacts forms cuenta con 24 drop down menú que me permite seleccionar unos números de los cuales una opción es 0. Hasta aquí tengo el código (Adjunto).

Lo que deseo es poder restringir los valores que los usuarios pueden seleccionar valores en el drop down menú; para este caso de los 24 que ahí el usuarios pueda como máximo seleccionar 6 opciones diferentes a 0.

Si alguien me pudiera ayudar seria de gran ayuda

Código
  1. <label> <FONT FACE="RARO" SIZE=5 COLOR="red"> *SEÑOR USUARIO RECUERDE QUE PUEDE PARTICIPAR UN MAXIMO DE 6 VECES DIARIAS EN EL PROGRAMA DE RD </FONT> </label>
  2.  
  3. <label> 0:00-1:00                                                                                                          
  4. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  5. [select* RD0  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>                                                
  6. <label> 1:00-2:00
  7. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  8. [select* RD1 "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  9. <label> 2:00-3:00
  10. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  11. [select* RD2  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>    
  12. <label> 3:00-4:00
  13. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  14. [select* RD3  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  15. <label> 4:00-5:00
  16. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  17. [select* RD4  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  18. <label> 5:00-6:00
  19. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  20. [select* RD5  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  21. <label> 6:00-7:00
  22. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  23. [select* RD6  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  24. <label> 7:00-8:00
  25. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  26. [select* RD7  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  27. <label> 8:00-9:00
  28. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  29. [select* RD8  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  30. <label> 9:00-10:00
  31. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  32. [select* RD9  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  33. <label> 10:00-11:00
  34. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  35. [select* RD10  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  36. <label> 11:00-12:00
  37. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  38. [select* RD11  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  39. <label> 12:00-13:00
  40. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  41. [select* RD12  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>    
  42. <label> 13:00-14:00
  43. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  44. [select* RD13  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  45. <label> 14:00-15:00
  46. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  47. [select* RD14  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  48. <label> 15:00-16:00
  49. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  50. [select* RD15  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  51. <label> 16:00-17:00
  52. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  53. [select* RD16  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  54. <label> 17:00-18:00
  55. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  56. [select* RD17  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  57. <label> 18:00-19:00
  58. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  59. [select* RD18  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  60. <label> 19:00-20:00
  61. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  62. [select* RD19  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  63. <label> 20:00-21:00
  64. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  65. [select* RD20  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  66. <label> 21:00-22:00
  67. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  68. [select* RD21  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  69. <label> 22:00-23:00
  70. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  71. [select* RD22  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  72. <label> 23:00-0:00
  73. <label> ELIJA LA PARTICIPACION PARA ESTA HORA [KVA]
  74. [select* RD23  "--SELECCIONE UNA--" "0" "50" "100" "150" "200" "250" "300" "350" "400" "450" "500"]</label>  
  75. <label> <FONT FACE="RARO" SIZE=5 COLOR="red"> GRACIAS POR PARTICIPAR EN EL PROGRAMA DE RD </FONT> </label>
  76. [submit "ENVIAR"]


Los códigos deben ir en etiquetas GeSHi
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines