Hi i am a php newbie and i am currently following a tutorial on how to make an login system and i am still at the login screen. Since i am new to php i don't know much about it. I hope someone expert can help me solve this problem. Here is the code
<?php
session_start();
include("connection.php");
include("functions.php");
if($_SERVER['REQUEST_METHOD'] == "POST");
{
//something was posted
$user_name = $_POST['user_name'];
$password = $_POST['password'];
if(!empty($user_name) && !empty($password) && !is_numeric($user_name));
{
//save to database
$user_id = random_num(20);
$query = "insert into users (user_id, user_name, password) values ("$user_id", "$user_name", "$password")";
mysqli_query($query);
header("location: login.php");
die;
} else
{
echo "Please enter some valid information!";
die;
}
}
?>
<input id="text" type="text" name="user_name">
<input id="text" type="password" name="password">
<input id="button" type="submit" value="signup">