this my code
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <title>Register</title>
- <script type="text/Javascript">
- function DisableSelect() {
- document.form.rd1[0].disabled = false;
- document.form.rd1[1].disabled = false;
- document.form.rd1[2].disabled = true;
- document.form.rd1[3].disabled = true;
- document.form.rd1[4].disabled = true;
- }
- function EnableSelect() {
- document.form.rd1[0].disabled = true;
- document.form.rd1[1].disabled = true;
- document.form.rd1[2].disabled = false;
- document.form.rd1[3].disabled = false;
- document.form.rd1[4].disabled = false;
- }
- </script>
- </head>
- <body>
- <form name="form" method="post" action="Register.php">
- <table border="1" align="center" length=90% width=50%><Caption><h2>Registration</h2></caption>
- <tr>
- <td align="center">
- <input type="radio" name="rb" ID="Radio1" VALUE="Radio1" onblur="DisableSelect()">Bac 1       
- <input type="radio" name="rb" ID="Radio2" VALUE="Radio2" onblur="EnableSelect()">Bac 2
- </td>
- </tr>
- <tr>
- <td align="center"><input type=radio value=1 name=rd1 id=1>Sientifique       
- <input type=radio value=2 name=rd1 id=2>Littéraire <br>
- <input type=radio value=3 name=rd1 id=3>ES<br>
- <input type=radio value=4 name=rd1 id=4>Science De La vie       
- <input type=radio value=5 name=rd1 id=5>Science General<br>
- </td>
- </tr>
- <tr>
- <td align=middle>
- <input type="submit" name="submit" value="S'Inscrire">
- <input type="reset" name="reset" value="Effacer" align="right"></td></tr>
- </table>
- </form>
- </body>
- </html>
but the information within the radio is not working
Expand|Select|Wrap|Line Numbers
- <?php session_start();
- include("entete.html");
- mysql_connect("localhost","root","") or die("Failed to open connection to MySQL server".mysql_error());
- $con=mysql_select_db("ecole") or die("Failed to select the database".mysql_error());
- $us=session_name();
- $sql= mysql_query("SELECT ID_etu FROM etudiante WHERE userName_etu='$us'");
- $user=$_GET["userNom"];
- $branche=$_POST["rb"];
- $spec=$_POST["rd1"];
- $result=mysql_query("INSERT INTO etudiante ('branche','Specialite') VALUES('$branche', '$spec') where ID_etu='$idetu' ");
- if($result)
- {
- echo("correct");
- }
- else
- {
- echo("false".mysql_error());
- }
- ?>
Thanks