Why my register form don't accept spry validation in dw? [migrated]
- by shaghayeh
Why my register form don't accept spry validation in dw?
Here is my code:
<?php
if(isset($_POST['go_register']))
{
$last_login=jdate('Y/n/j ,H:i:s');
$firstname=trim($_POST['firstname']);
$lastname=trim($_POST['lastname']);
$email=trim($_POST['username']);
$password=sha1($_POST['password']);
$register_date=$_POST['register_date'];
if(!empty($firstname)&&
!empty($lastname)&&
!empty($email)&&
!empty($password)&&
!empty($register_date)){
$reg_query="insert into users(firstname,lastname,email,password,register_date,last_login)values('$firstname','$lastname','$email','$password','$register_date','$last_login')";
$reg_result=mysqli_query($connection,$reg_query);
if($reg_result){
echo "ok";
}
}//end of not empty
}//end of isset
?>
<div class="sectionclass">
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<h2>??? ??? ???</h2>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']."?catid=2"; ?>">
<div>
<span style="color:#F00">*</span> <label>??? </label>
<span id="sprytextfield1">
<input type="text" name="firstname" />
<span class="textfieldRequiredMsg">A value is required.</span></span></div>
<div>
<span style="color:#F00">*</span> <label>??? ????????</label><input type="text" name="lastname" />
</div>
<div>
<span style="color:#F00">*</span> <label>??? ??????(?????)</label><input dir="ltr" type="text" name="username" />
</div>
<div>
<span style="color:#F00">*</span> <label>??? ????</label><input type="password" name="password" />
</div>
<input type="hidden" name="register_date" value="<?php echo jdate('Y/n/j'); ?>">
<div>
<input type="submit" name="go_register" value="??? ???"/>
</div>
</form>
</div>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
</script>