I am new to PHP and I started using XAMPP to build the site. I have the code below
db.php:
<?php
$hostName='localhost';
$userName='xxxxxxxxx';
$userPass='xxxxxxxxx';
?>
and test.php:
<?php
include 'db.php';
echo $hostName;
?>
but now it shows me Note: Undefined variable: hostName
I found that register_globals needs to be set to "on" in php.ini, but after I installed it, XAMPP show: The 'register_globals' directive is no longer available in PHP when I restart XAMPP.
I am moving the same code in Hosting24, but it works, who can help?
source
share