-
Notifications
You must be signed in to change notification settings - Fork 0
/
vender_singup.php
96 lines (78 loc) · 3.13 KB
/
vender_singup.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
session_start();
include("connect.php");
if (isset($_SESSION['username'])) {
header("location:vender_homepage.php");
}
if (isset($_POST['btnsubmit'])) {
$vname = ($_POST['vdname']);
$vemail = ($_POST['vdemail']);
$vaddress = ($_POST['vaddress']);
$vphne = ($_POST['vdphone']);
$vusername = ($_POST['vusername']);
$vpassword = ($_POST['vpassword']);
$_SESSION['vdname'] = $vname;
$_SESSION['vemail'] = $vemail;
$_SESSION['vaddress'] = $vaddress;
$_SESSION['vphne'] = $vphne;
$_SESSION['vusername'] = $vusername;
$_SESSION['vpassword'] = $vpassword;
header("location:vender_singup2.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="singup.css">
<script>
function validateForm() {
var vdname = document.forms["signupForm"]["vdname"].value;
var vdemail = document.forms["signupForm"]["vdemail"].value;
var vaddress = document.forms["signupForm"]["vaddress"].value;
var vdphone = document.forms["signupForm"]["vdphone"].value;
var vusername = document.forms["signupForm"]["vusername"].value;
var vpassword = document.forms["signupForm"]["vpassword"].value;
var confirm_password = document.forms["signupForm"]["confirm_password"].value;
// Email validation
var emailRegex = /\S+@\S+\.\S+/;
if (!emailRegex.test(vdemail)) {
alert("Invalid email address");
return false;
}
// Phone number validation
if (isNaN(vdphone) || vdphone.length !== 10) {
alert("Invalid phone number. Please enter 10 digits.");
return false;
}
// Password match validation
if (vpassword !== confirm_password) {
alert("Passwords do not match");
return false;
}
return true;
}
</script>
</head>
<body>
<form name="signupForm" action="" method="POST" onsubmit="return validateForm()">
<div class="container">
<div class="top"></div>
<div class="bottom"></div>
<div class="center">
<h2><b>Bid Bazzar</b></h2>
<input type="text" name="vdname" placeholder="Vendor's Name" required>
<input type="email" name="vdemail" placeholder="Vendor's Email">
<input type="text" name="vaddress" placeholder="Vendor Address" />
<input type="text" name="vdphone" placeholder="Vendor's Phone no.">
<input type="text" placeholder="User Name" name="vusername" />
<input type="password" placeholder="Password" name="vpassword" />
<input type="password" placeholder="Confirm Password" name="confirm_password" />
<p><b>Already Have An Account?<a href="login.php">LOGIN</a></b></p>
<input type="Submit" value="Next" id="button" name="btnsubmit" />
</div>
</div>
</form>
</body>
</html>