forked from Anupama-Github/rasi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.php
72 lines (69 loc) · 2.18 KB
/
form.php
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Registeration for user</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.1.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js"></script> <!-- http://bassistance.de/jquery-plugins/jquery-plugin-validation/ -->
<script type="text/javascript">
$(document).ready(function(){
$("#myform").validate({
debug: false,
rules: {
username: "required",
password: "required",
email: {
required: true,
email: true
}
},
messages: {
username: "Please let us know who you are.",
password: "Password must be provided",
email: "A valid email is required",
},
submitHandler: function(form) {$("#myform").hide();
// do other stuff for a valid form
$.post('register.php', $("#myform").serialize(), function(data) {
$('#results').html(data);
//alert("Form submitted successfully!!!");
});
}
});
});
</script>
<style>
label.error { width: 250px; display: inline; color: red;}
</style>
</head>
<body>
<?php
if(isset($_GET["op"]))
{ if($_GET["op"]=='error')
{
echo $_GET['err'].", please change your username";
}
}
?>
<form name="myform" id="myform" action="" method="POST">
<!-- The Name and password form fields -->
<fieldset>
<label for="username" id="username_label">Username</label>
<input type="text" name="username" id="username" size="30" value=""/>
<br>
<label for="password" id="password_label">Password</label>
<input type="password" name="password" id="password" size="30" value=""/>
<br>
<!-- The Email form field -->
<label for="email" id="email_label">Email</label>
<input type="text" name="email" id="email" size="30" value=""/>
<br>
<!--fieldest -->
</fieldset>
<input type="submit" name="submit" value="Submit">
</form>
<!-- We will output the results from process.php here -->
<div id="results">
</div>
</body>
</html>