Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submit functionality #3

Merged
merged 1 commit into from Oct 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 29 additions & 1 deletion submit.php
@@ -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>";
}
}
?>