I need help with my PHP database for a login service


#1


//This is register.php 
<?php require 'Fajita/Connections/Connections.php'; ?>

<?php

   if(isset($_POST['Register'])){
	   
	   session_start();
	   $FName = $_POST['First_Name'];
	   $LName = $_POST['Last_Name'];
	   $Email = $_POST['Email'];
	   $Password = $_POST['Password'];
	   
	   $sql = $con->query("INSERT INTO user (Fname, Lname, Email, Password)VALUES('{$FName}','{$LName}','{$Email}','{$Password})");
	   
	   header('Location:Login.php');
   }
?>

<!doctype html>
<html>
<head>

<link href="Fajita/FajitaCSS/Master.css" rel="stylesheet" type="text/css" />
<link href="Fajita/FajitaCSS/Menu.css" rel="stylesheet" type="text/css" />

<meta charset="utf-8">

<title>Register</title>

</head>

<body class="RightBody">
     <div class="Container">
<div class="Header"></div>
     <div class="Menu">
     <div id="Menu">
     <nav>
	
     <ul class="cssmenu">
		   <li><a href="#">Register</a></li>	
  	       <li><a href="#">Login</a></li>	
  	
     </ul>
    
     </nav>
    
     </div>
     </div>
     <div class="LeftBody"></div>
     <div class="RightBody">
     <form id="Registerform" name="Registerform" method="post">
     <div class="FormElement">
     <input name="First_Name" type="text" required="required" class="TField" id="First_Name" placeholder="First Name">
     </div>
     <div class="FormElement">
     <input name="Last_Name" type="text" required class="TField" id="Last_Name" placeholder="Last Name">
     </div>
     <div class="FormElement">
     <label for="Email">
     <input name="Email" type="text" required class="TField" id="Email" placeholder="Email">
     </label>
     </div>
     <div class="FormElement">
     <input name="Password" type="text" required class="TField" id="Password" placeholder="Password">
     </div>
     <div class="FormElement">
     <input name="Register" type="button" class="button" id="Register" value="Register">
     </div>
     </form>
     </div>
     <div class="footer"></div>
</body>
</html>

//This is connections.php
<?php
$con = mysqli_connect("localhost","root","******","login");


?>


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.