PHP directory warning and fatal error for require

Viewed 209

Warning: require(/user-settings/register.php): failed to open stream: No such file or directory in D:\xampp\htdocs\Project\Blog\register-page.php on line 4

Fatal error: require(): Failed opening required '/user-settings/register.php' (include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\Project\Blog\register-page.php on line 4

I want to include connect.php and register.php in the file register-page.php, but I get an error. I am also using the connect.php file in the register.php file.

<?php 

require 'database-settings/connect.php';
require_once 'user-settings/register.php'; 

?>

enter image description here

1 Answers

You should put this /user-settings/register.php instead of /user-settings/register.php because you are not in the same folder with user-settings you are inside of it.

Related