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


 


Tema destacado: Doble factor de autenticación o verificación en dos pasos


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web
| | |-+  PHP (Moderador: #!drvy)
| | | |-+  html y phpmyadmin
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: html y phpmyadmin  (Leído 286 veces)
cristiangonzalez

Desconectado Desconectado

Mensajes: 2


Ver Perfil
html y phpmyadmin
« en: 27 Julio 2017, 20:52 »

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


« Última modificación: 28 Julio 2017, 02:52 por engel lex » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines