0

I have a question here. Somehow my created registration form doesn't appear on the website. When I am deleting all the include files, it shows, but with the files - it does not. Could someone help me to solve this problem? What I'm doing wrong?

Here is my register.php file:

<!DOCTYPE html>
<?php
include 'classes/connection.php';
include 'classes/register.php';
$connection = new Connection();
$users = new Users($connection);
$users->insertUserValues();
?>
<html>
<head>
    <meta charset="UTF-8">
    <title>
    </title>
</head>
<body>
    <div class="form">
        <form method ="post" action="register.php">
            Vardas:<br>
            <input type="text" name="name" id="name" placeholder="Vardas" required>
            <br>
            Pavardė:<br>
            <input type="text" name="surname" id="surname" placeholder="Pavardė" required>
            <br>
            Prisijungimo vardas:<br>
            <input type="text" name="username" id="username" placeholder="Prisijungimo vardas" required>
            <br>
            Slaptažodis:<br>
            <input type="password" name="password" id="password" placeholder="Slaptažodis" required>
            <br>
            Patvirtinti slaptažodį:<br>
            <input type="password" name="confirm_password" id="confirm" placeholder="Slaptažodis" required>
            <br>
            El. pašto adresas: <br>
            <input type="email" name="email" id="email" placeholder="El. pašto adresas" required>
            <br><br>
            <input type="submit" name="submit" id="submit" value="Registruotis">
            </form> 
    </div>
</body>

The link I'm entering to the registration form is correct, I've also tried to go from index.php, but it's the same..

user7435747
  • 417
  • 2
  • 5
  • 11

1 Answers1

-1

Without checking if $_POST['submit'] was set (or any other post var), you immediately call $users->insertUserValues();

What happens inside that? Can we see? I would suggest an if statement to check the form was posted before trying to process non-existent data.

delboy1978uk
  • 12,118
  • 2
  • 21
  • 39
  • there is a high chance that it is a syntax error in one of the files included. – Rotimi Apr 19 '17 at 12:16
  • Check inside your insertUserValues() method. Also, look into your error_log and see if you can get any error messages to help with your debugging. – delboy1978uk Apr 19 '17 at 12:49