I got some code from CodexWorld. In it one of the files has a line
include 'user.php'
I have a user.php file, but is it common to use an include in PHP? How does having an include line up with the whole MVC paradigm? Here is the top of my userAccount.php file:
<?php
//start session
//session_start();
//load and initialize user class
include 'user.php';
$user = new User();
if(isset($_POST['signupSubmit'])){
//check whether user details are empty
if(!empty($_POST['first_name']) && !empty($_POST['last_name']) && !empty($_POST['email']) && !empty($_POST['phone']) && !empty($_POST['password']) && !empty($_POST['confirm_password'])){
//password and confirm password comparison
if($_POST['password'] !== $_POST['confirm_password']){
$sessData['status']['type'] = 'error';
I commented out the session_start since phpstorm is complaining that I already have a session started. I am not sure why I would need to start another session.
include 'user.php'
I have a user.php file, but is it common to use an include in PHP? How does having an include line up with the whole MVC paradigm? Here is the top of my userAccount.php file:
<?php
//start session
//session_start();
//load and initialize user class
include 'user.php';
$user = new User();
if(isset($_POST['signupSubmit'])){
//check whether user details are empty
if(!empty($_POST['first_name']) && !empty($_POST['last_name']) && !empty($_POST['email']) && !empty($_POST['phone']) && !empty($_POST['password']) && !empty($_POST['confirm_password'])){
//password and confirm password comparison
if($_POST['password'] !== $_POST['confirm_password']){
$sessData['status']['type'] = 'error';
I commented out the session_start since phpstorm is complaining that I already have a session started. I am not sure why I would need to start another session.