Jump to content

Ashcartwright

New Members
  • Posts

    1
  • Joined

  • Last visited

Ashcartwright's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I have set up a database called "enigmadb" with a table called "user", I have created the database connection in a file called "connection.php", and I also have a page called "Register.php" where i have created a form and a query, but when I try to submit the data using the for nothing happens, and I cant seem to find out why this is, I'm assuming there is an issue with the database connection, but it looks OK to me, but this is the first time i have used MYSQLI and i have alot to learn. Thanks. Database: UserID int(11) AUTO_INCREMENT Fname varchar(200) latin1_swedish_ci Yes NULL Lname varchar(200) latin1_swedish_ci Yes NULL Email varchar(200) latin1_swedish_ci Yes NULL Username varchar(200) latin1_swedish_ci Yes NULL Password varchar(200) latin1_swedish_ci Yes NULL Timestamp timestamp No CURRENT_TIMESTAMP UserLevel int(11) No 1 ProfileImage text latin1_swedish_ci Yes NULL Bio text latin1_swedish_ci Yes NULL Connection.php stored in a connection folder. <?php $con = mysqli_connect("localhost", "root", "password", "enigmadb"); if (!$con) { die('Could not connect: ' . mysql_error()); } ?> Register.php <?php require 'Connection/Connections.php'; ?> <?php if(isset($_POST['Register'])){ session_start(); $FName = $_POST['First_Name']; $LName = $_POST['Last_Name']; $Email = $_POST['Email']; $PW = $_POST['Password']; $sql = $con->query("INSERT INTO user (Fname, Lname, Email, Password)Values('{$FName}', '{$LName}', '{$Email}', '{$PW}')"); header('Location: Login.php'); } ?> <!doctype html> <html> <head> <link href="CSS/Master.css" rel="stylesheet" type="text/css" /> <link href="CSS/Menu.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { background-color: #000000; background-image: url(Assets/bg.jpg); background-repeat: no-repeat; } </style> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="styles.css"> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script src="script.js"></script> <title>Register</title> </head> <body> <div class="Container"> <div class="Header"></div> <div class="Menu"> <div id="Menu"> <div id='cssmenu'> <ul> <li><a href='#'><span>Login</span></a></li> <li><a href='#'><span>Register</span></a></li> <li class='last'><a href='#'><span>Contact</span></a></li> </ul> </div> </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 class="TField" id="First_Name" placeholder="First Name"> </div> <div class="FormElement"> <input name="Last_Name" type="text" required="required" class="TField" id="Last_Name" placeholder="Last Name"> </div> <div class="FormElement"> <input name="Email" type="email" required="required" class="TField" id="Email" placeholder="Email"> </div> <div class="FormElement"> <input name="Password" type="password" required="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> </div> <p> </p> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.