<!DOCTYPE html>
<html>
<!--Title-->
<title>Saint Services</title>
<!--Links-->
<link rel="stylesheet" href="style.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<script src="code.js"></script>
</head>
<body>
<header class="nav">
<div class="mb-4 logo">
<logo><img src="imageslogo-sac.png" width="50" length="50" alt="logo"></logo>
</div>
<div class="home">
<links><a href="test.html"><img src="imageshome.png" width="75" length="75" alt="home"></a></links>
</div>
<div class="settings">
<links><a href="style.css"><img src="imagescog.png" width="75" length="75" alt="settings"></a></links>
</div>
<div class="profile">
<links><a href="login.php"><img src="imagesperson.png" width="75" length="75" alt="person"></a></links>
</div>
<div class="donations">
<links><a href="donate.php"><img src="imagesdonate.png" width="75" length="75" alt="donations"></a></links>
</div>
</header>
<br>
<div class="section">
<div class="container">
<div class="row full-height justify-content-center">
<div class="col-12 text-center align-self-center py-5">
<div class="section pb-5 pt-5 pt-sm-2 text-center">
<h6 class="text"><span>Log In </span><span>Sign Up</span></h6>
<input class="checkbox" type="checkbox" id="reg-log" name="reg-log"/>
<label for="reg-log"></label>
<div class="card-3d-wrap mx-auto">
<div class="card-3d-wrapper">
<div class="card-front">
<div class="center-wrap">
<div class="section text-center">
<form action="login.php" method="post">
<text><h4 class="text mb-4 pb-3">LOG IN</h4></text>
<div class="form-group">
<input type="email" name="EMAIL" class="form-style" placeholder="*Email" id="logemail" autocomplete="off">
<i class="input-icon uil uil-at"></i>
</div>
<div class="form-group mt-2">
<input type="password" name="PASSWORD" class="form-style" placeholder="*Password" id="logpass" autocomplete="off">
<i class="input-icon uil uil-lock-alt"></i>
</div>
<a type="submit" href="donate.php" class="btn mt-4">SUBMIT</a>
<p class="mb-0 mt-4 text-center"><a href="" class="link">Forgot your password?</a></p>
</div>
</div>
</div>
<div class="card-back">
<div class="center-wrap">
<div class="section text-center">
<text><h4 class="text">SIGN UP</h4></text>
<form action="test.php" method="post">
<div class="form-group">
<input type="text" name="FIRST_NAME" class="form-style" placeholder="*First Name" id="FIRST_NAME" autocomplete="off">
<i class="input-icon uil uil-user"></i>
</div>
<div class="form-group mt-2">
<input type="text" name="SURNAME" class="form-style" placeholder="*Surname" id="SURNAME" autocomplete="off">
<i class="input-icon uil uil-user"></i>
</div>
<div class="form-group mt-2">
<input type="text" name="MOBILE_NUMBER" class="form-style" placeholder="*Phone Number" id="MOBILE_NUMBER" autocomplete="off">
<i class="input-icon uil uil-user"></i>
</div>
<div class="form-group mt-2">
<input type="email" name="EMAIL" class="form-style" placeholder="*Email" id="EMAIL" autocomplete="off">
<i class="input-icon uil uil-at"></i>
</div>
<div class="form-group mt-2">
<input type="password" name="PASSWORDS" class="form-style" placeholder="*Password" id="PASSWORDS" autocomplete="off">
<i class="input-icon uil uil-lock-alt"></i>
</div>
<div class="form-group mt-2">
<input type="password" name="CONFIRM_PASSWORD" class="form-style" placeholder="*Confirm Password" id="CONFIRM_PASSWORD" autocomplete="off">
<i class="input-icon uil uil-lock-alt"></i>
</div>
<a type="submit" class="btn mt-4" onclick="return signinValid()">SUBMIT</a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<footer>
<div class="mb-4 logo">
<logo><img src="imageslogo-sac.png" width="50" length="50" alt="logo"></logo>
<p>Name</p>
</div>
<?php
//PHP
//Connection to database
require("login.php");
//Signup
$conn = new mysqli("localhost","admin","30:]thrib#day*01$2007","fa3") or die(mysqli_error($conn));
if(isset($_POST["submit"])){
$fname = $_POST["FIRST_NAME"];
$lname = $_POST["SURNAME"];
$mobile = $_POST["MOBILE_NUMBER"];
$email = $_POST["EMAIL"];
$pass = $_POST["PASSWORDS"];
$cpass = $_POST["CONFIRM_PASSWORD"];
}
$query = mysqli_query($conn,"INSERT INTO users VALUES(FIRST_NAME, SURNAME, MOBILE_NUMBER, EMAIL, PASSWORDS, CONFIRM_PASSWORDS)
VALUES($fname, $lname, $mobile, $email, $pass, $cpass)") or die(mysqli_error($conn));
//Login
?>
The code reads the variables $fname, $lname, $mobile, $pass, $cpass as undefined in my variable then I get a fatal error. The php is on another page called test.php. My teacher recommended putting it on two different pages to make sure php is not ‘confused’. I don’t care about validation as I used my Javascript for that. This my last resort and it is due tommorrow.
Warning: Undefined variable $fname in C:xampphtdocsdstest.php on line 23
Warning: Undefined variable $lname in C:xampphtdocsdstest.php on line 23
Warning: Undefined variable $mobile in C:xampphtdocsdstest.php on line 23
Warning: Undefined variable $email in C:xampphtdocsdstest.php on line 23
Warning: Undefined variable $pass in C:xampphtdocsdstest.php on line 23
Warning: Undefined variable $cpass in C:xampphtdocsdstest.php on line 23
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘VALUES(, , , , , )’ at line 2 in C:xampphtdocsdstest.php:22 Stack trace: #0 C:xampphtdocsdstest.php(22): mysqli_query(Object(mysqli), ‘INSERT INTO use…’) #1 {main} thrown in C:xampphtdocsdstest.php on line 22