reg.php is in members
folder
<?php include "members/reg.php";?> // doesn't work
<?php include ("members/reg.php");?> // doesn't work
Then I replace reg.php
in the same folder as the current file
<?php include "reg.php";?> //doesn't work.
PHP Include Files. The include (or require ) statement takes all the text/code/markup that exists in the specified file and copies it into the file that uses the include statement. Including files is very useful when you want to include the same PHP, HTML, or text on multiple pages of a website.
If the file is included twice, PHP will raise a fatal error because the functions were already declared. It is recommended to use include_once instead of checking if the file was already included and conditionally return inside the included file.
Try this
ini_set( 'error_reporting', E_ALL );
ini_set( 'display_errors', true );
include './members/reg.php';
Possibly the include worked but caused a silenced error.
With:
define('ROOT', dirname(__FILE__).DIRECTORY_SEPARATOR);
you can define the root of your project (which is the one the file you put it in) and then call:
include ROOT."members/reg.php";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With