Skip to content

Commit

Permalink
Merge pull request #3 from fadkeabhi/patch-3
Browse files Browse the repository at this point in the history
submit functionality
  • Loading branch information
rameshwaghmare123 committed Oct 28, 2022
2 parents 0dcb672 + 2967ce1 commit 7a66d6f
Showing 1 changed file with 29 additions and 1 deletion.
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>";
}
}
?>

0 comments on commit 7a66d6f

Please sign in to comment.