-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98220c2
commit 7478afd
Showing
5 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
|
||
<?php | ||
session_start(); | ||
if ($_POST) { | ||
$name = $_POST['name']; | ||
$email = $_POST['email']; | ||
$pass = $_POST['pass']; | ||
$Re_pass = $_POST['Re-pass']; | ||
|
||
if (empty($name)) { | ||
$_SESSION['msg'] = "Please enter you name"; | ||
|
||
}elseif(empty($email)){ | ||
$_SESSION['msg'] = "Please enter valid email address."; | ||
|
||
}elseif(empty($pass)){ | ||
$_SESSION['msg'] = "Please enter password"; | ||
|
||
}elseif($pass !== $Re_pass){ | ||
$_SESSION['msg'] = "Re-entered password didn't matched.<br> Enter password again."; | ||
|
||
}else{ | ||
include_once "DB/table_Create.php"; | ||
TableCreate(); | ||
|
||
include_once "DB/DB_Connection.php"; | ||
$conn = DataBaseConnection(); | ||
|
||
$sql = "SELECT * FROM users WHERE email = '$email'"; | ||
|
||
$result = $conn->query($sql); | ||
|
||
|
||
if ($result->num_rows > 0) { | ||
$_SESSION['msg'] = "User already exists in the system"; | ||
}else{ | ||
$sql = "INSERT INTO users (name, email, pass) VALUES ('$name','$email', '$pass')"; | ||
if($conn->query($sql)){ | ||
$_SESSION['msg'] = "User is registered successfully"; | ||
}else { | ||
$_SESSION['msg'] = "Error:".$conn->error; | ||
} | ||
} | ||
} | ||
|
||
header("location:../signup.php"); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
<!-- head --> | ||
<?php include_once"templating/head.php" ?> | ||
|
||
<!-- Navigation --> | ||
<?php include_once"templating/main_nav.php" ?> | ||
|
||
|
||
<!-- Page Content --> | ||
<div class="container"> | ||
|
||
<div class="row justify-content-center"> | ||
|
||
<div class="col-lg-6 bg-dark text-light pb-5 pt-5"> | ||
<!-- < ?php if(isset($_GET['name'])){ ?> --> | ||
<form action="php/userReg.php" method="post"> | ||
<legend class="text-center text-uppercase">User Registration</legend> | ||
<div class="form-group"> | ||
<label for="name">Full Name :</label> | ||
<input type="text" name="name" id="name" class="form-control" placeholder="Example: John Doe" value=''> | ||
</div> | ||
<div class="form-group"> | ||
<label for="email">Email :</label> | ||
<input type="email" name="email" id="email" class="form-control" placeholder="Example: [email protected]"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="pass">Password :</label> | ||
<input type="password" name="pass" id="pass" class="form-control" placeholder="******"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="Re-pass">Re-enter Password :</label> | ||
<input type="password" name="Re-pass" id="Re-pass" class="form-control" placeholder="******"> | ||
</div> | ||
<div class="form-group"> | ||
<input type="submit" class="form-control btn btn-success mt-4" value="SUBMIT"> | ||
</div> | ||
<p class="h4 text-center"><?php if (isset($_SESSION['msg'])) { | ||
echo($_SESSION['msg']); | ||
unset($_SESSION['msg']); | ||
} ?></p> | ||
</form> | ||
|
||
<!-- < ?php }?> --> | ||
|
||
</div> | ||
|
||
</div> | ||
<!-- /.row --> | ||
|
||
</div> | ||
<!-- /.container --> | ||
|
||
<!-- Footer --> | ||
<?php include_once"templating/footer_area.php" ?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<?php session_start() ?> | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters