Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <head>
- <title>Prueba</title>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
- <script languaje="javascript">
- function habilita(form)
- {
- form.bildemu[0].disabled = true;
- form.bildemu[1].disabled = true;
- }
- function deshabilita(form)
- {
- form.bildemu[0].disabled = false;
- form.bildemu[1].disabled = false;
- }
- </script>
- </head>
- <body>
- <form action="procesaPrueba.php" method="post">
- <p>
- <label for="name">Apellido:</label>
- <input type="text" name="name"required id="name"=>  
- <!--para introducir comentarios-->
- <label for="vorname">Nombre:</label>
- <input type="text" name="vorname"required id="vorname"></br>
- <i>Elige una lengua-B:</i>
- <input type="radio" name="b_sprache" value="Spanisch B"onClick="habilita(this.form)"> Español B
- <input type="radio" name="b_sprache" value="Italienisch B"onClick="habilita(this.form)"> Italiano B
- <input type="radio" name="b_sprache" value="Französisch B"onClick="habilita(this.form)"> Francés B </br>
- <i>Para las clases 12/13 me inscribo en las siguientes asignaturas:</i></br>
- <input type="radio" name="bildemu" value="Arte">
- <label for="Arte">Arte</label>
- <input type="radio" name="bildemu" value="Música">
- <label for="Musica">Música,</label> </br>
- <i>y</i>
- <input type="radio" name="ct" required id="ct" value="Computertechnik">
- <label for="ct">Técnica de ordenadores.</label></br>
- </br></br>
- <input type="submit" value="Enviar">
- <input type="reset">
- </br></br>
- </form>
- </body>
- <?php
- $bildemu=$_POST['bildemu'];
- $b_sprache=$_POST['b_sprache'];
- $name=$_POST['name'];
- $vorname=$_POST['vorname'];
- $ct=$_POST['ct'];
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "schule3";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection fallida: " . $conn->connect_error);
- }
- $sql = "INSERT INTO schule3(name, vorname, b_sprache, bildemu, ct)
- VALUES ('$name', '$vorname', '$b_sprache','$bildemu','$ct',)";
- if ($conn->query($sql) === TRUE) {
- echo "das Formular wurde geschickt!";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement