I am trying to have an if statement appear if a user is logged in. Here is the code
PHP Code:
require 'classLogin.php';

<!DOCTYPE html>
<html lang="en">


    <div class="container">

      <form method="post" action="form.php">
        <h2>Please sign in</h2>
        <input type="text" class="form-control" name="user_name" placeholder="Email address" value="<?php if(isset($_POST['user_name'])) { echo ($_POST['user_name']);} ?>" >
        <input type="password" class="form-control" name="user_password" placeholder="Password" autofocus>
        <button name="submit" type="submit">Sign in</button>
= new Login;

$_POST['submit'])) {

if (
$user_is_logged_in true) {

PHP Code:
          public $user_is_logged_in false;

public function 
if ((
$query->num_rows == 1) && ($_POST['user_password'] === $result->user_password)) {
"You are now logged in " $this->user_name "";
$this->user_is_logged_in true;

For some reason the echo "USER IS LOGGED IN" appears no matter what I type in the statement such as "
PHP Code:
if ($user_logd_in tr

Ive been stuck for a few hours now so hopefully somebody can determine the issue and hopefully show an efficient way to do something like this.