-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from fadkeabhi/patch-3
submit functionality
- Loading branch information
Showing
1 changed file
with
29 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,29 @@ | ||
//registration implementation 2 | ||
<?php | ||
require('includes/config.php'); | ||
|
||
$user = $_POST['user']; | ||
$enroll = $_POST['enroll']; | ||
$pass = $_POST['pass']; | ||
$re_pass = $_POST['re-pass']; | ||
|
||
if($user=="" || $pass=="" || $re_pass == "" || $enroll == "" ) | ||
header('location:reg.php?err=0'); | ||
// echo $user." ".$pass." ".$re_pass | ||
else | ||
if($pass!=$re_pass) | ||
header('location:reg.php?err=1'); | ||
else { | ||
$sql = "SELECT null FROM stud_data WHERE usr_name='".$user."' OR usr_roll='".$enroll."'"; | ||
$result = mysql_query($sql); | ||
$count = mysql_num_rows($result); | ||
if($count>0) | ||
header('location:reg.php?err=2'); | ||
else { | ||
$pass = md5("5".$pass."@"); | ||
$sql = "INSERT INTO stud_data (usr_name,usr_roll,usr_pass) VALUES('".$user."','".$enroll."','".$pass."')"; | ||
mysql_query($sql); | ||
echo "Registered Successfully, <a href='index.php'>Login</a>"; | ||
} | ||
} | ||
?> | ||
|