Bonjour à tous, je n'arrive pas à vérifier le formulaire ci dessous et à empêcher son envoie. Merci de m'aider :p

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php 
        include('config.php');
        if(isset($_POST['submit']) && $_POST['submit'] == 'Envoyer') {
                $username = mysql_real_escape_string($_POST['username']);
                $password = mysql_real_escape_string($_POST['password']);
                $rl_name = mysql_real_escape_string($_POST['rl_name']);
                $email = mysql_real_escape_string($_POST['email']);
                $social_id = mysql_real_escape_string($_POST['reset']);
                
                $sql = "INSERT INTO account SET login = '".$username."', password = PASSWORD('".$password."'), real_name = '".$rl_name."',social_id = '".$social_id."', email = '".$email."'";
                $result = mysql_query($sql);
                if($result) { echo 'Félicitation, Vous avez créé un compte.'; } else { echo 'Erreur vérifiez toutes vos informations !'; }
        }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Inscription</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Inscription" />
<meta name="keywords" content="some, keywords, comes, later" />
<meta name="language" content="en" />
<meta name="robots" content="index,follow" />
<meta name="author" content="S3cr3t" />
<meta name="revisit-After" content="5 days" />
<meta name="distribution" content="local" />
<style type="text/css">
<!--
body 		{
	background:#000;
	color:#990066;
	font:bold 8pt Verdana,Arial,Helvetica,sans-serif;
	background: #000000;
}
#container	{ margin:40px auto; width:750px; overflow:hidden; }
#text 		{ padding:5px; }
#text ul 	{ padding:0px; margin-left:40px; }
#text li 	{ display:block; }
#left 		{ float:left; }
#right 		{ float:right; margin-right:15px; }
!.Style1 {color: #FF0000}
a:link {
	color: #FFFFFF;
}
a:hover {
	color: #FF0000;
}
.Style3 {color: #FFFFFF}
.Style4 {
	font-size: 16pt;
	text-decoration: blink;
}
.Style5 {
	font-size: 14px;
}
.Style6 {
	color: #990066;
	background-color: #FFFFFF;
	font-style: inherit;
}
.Style7 {font-size: 9px}
-->
</style>
<script type="text/javascript">
function CheckValid(form)
{
	if (form.username.value.length<6)
	{
	    alert("identifiant aux moins de 6 caracteres");
	    return false;
	}
	if (form.username.value.length>14)
	{
	    alert("identifiants aux maximum de 16 caracteres");
	    return false;
        }
        if (form.username.value==form.Password.value)
        {
            alert("identifiant incorrecte")
            return false;
        }
	if (form.password.value.length<6)
	{
	    alert("Mot de passe aux moins de 6 caracteres");
	    return false;
	}
	if (form.password.value.length>16)
	{
	    alert("Mot de passe aux maximum de 16 caracteres");
	    return false;
        }
 
	if (form.password.value!=form.RPassword.value)
	{
	    alert("Mot de passe incorrecte");
	    return false;
        }
 
	if (form.email.value.length<5)
	{
	    alert("Email incorrecte");
	    return false;
	}
	if (form.email.value.length>50)
	{
	    alert("Email incorrecte");
	    return false;
        }
 
	if (form.rl_name.value.length<2)
	{
	    alert("Nom doit contenir minimum 2 lettres");
	    return false;
	}
	if (form.rl_name.value.length>24)
	{
	    alert("Nom doit contenir maximum 24 lettres");
	    return false;
        }	
 
</script>
 
</head>
<body>
 
  <p><img src="header.jpg" width="1253" height="212" /></p>
  <p align="left">&nbsp;</p>
  <p>&nbsp;</p>
  <p align="center" class="Style4 Style3"><em>Limit&eacute; &agrave; deux comptes par Joueur, sous peine d'un Ban IP.</em></p>
 
 
  <div style="background:#000000;">
    <form action="index.php" method="post" onSubmit="CheckValid(this)">
      <p align="center" class="Style5" >&nbsp;</p>
      <p align="center" class="Style5" >Nom de compte:      </p>
      <p align="center" class="Style5" >
        <input type="text" name="username" size="35" />
      </p>
      <p align="center" class="Style5">Mot de passe :</p>
      <p align="center" class="Style5">     				  
        <input type="password" name="password" id="password" size="35" />
      </p>
      <p align="center" class="Style5">Code effacement du perso :
        <label><br />
        <span class="Style7">(1234567 par defaut ) </span><br />
        <input name="reset" type="text" id="reset" value="1234567" size="35" />
        </label>
      </p>
      <p align="center" class="Style5">Pr&eacute;nom :</p>
      <p align="center" class="Style5"> 
        <input type="text" name="rl_name" size="35" />
      </p>
      <p align="center" class="Style5">E-Mail :</p>
      <p align="center" class="Style5">
        <input name="email" type="text" size="35" />
      </p>
      <p align="center" class="Style5">&nbsp;</p>
      <div align="center">
        <ul>
        </ul>
      </div>
      <ul>
        <p align="center" class="Style5">  </li>
        <input name="submit" type="submit" class="Style6" onclick="CheckValid(this)" value="Envoyer"/>
        </p>
        <p align="center" class="Style5">&nbsp;</p>
      </ul>
    </form>
</div>
 
 
</body>
</html>