Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_SERVER['REQUEST_METHOD'] === 'POST'){ // Page was POSTed to. Typically from a form
- mysql_connect("localhost", "root", "") or die("Unable to connect to MySQL");
- echo "Connected!!<br>";
- mysql_select_db("login") or die ("No such Database Found");
- $fname = $_POST['fname']; //fname is a field in table named log_details
- $lname = $_POST['lname']; //lname is a field in table named log_details
- $mail = $_POST['mail']; //mail is a field in table named log_details
- $cid = $_POST['cid']; //cid is a field in table named log_details
- $psswrd = $_POST['psswrd']; //psswrd is a field in table named log_details
- $cpsswrd = $_POST['cpsswrd']; //cpsswrd is a field in table named log_details
- //checking if data is already available or not
- $query = mysql_query("SELECT fname,lname FROM login_details WHERE fname='{$fname}' AND lname='{$lname}' AND mail='{$mail}'" );
- //tells the no of rows for which the data matched
- $rows = mysql_num_rows($query);
- //if data already present
- if($rows>0) {
- echo "data already present fill again";}
- //if data is not in database checks if the password and confirm password matches then insert value or else not
- }else{ if($psswrd==$cpsswrd){
- echo "value inserted";
- }else{
- echo "hell";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement