A quick overview of the situation:
-
i run XAMPP on Windows
-
in its htdocs folder, i placed a folder for my free-hand made site – practice.com
-
inside, an .htaccess file (with a single line of code: DirectorIndex index.php)
-
the file named index.php contains the following 2 lines:
require customer.php (a Class file…a single text file, with 2 simple variables, customer name and age…used to create a customer object in page_1.php)
require page_1.php (my site’s 1st page, to display everything, included the PHP code…this was named, originally, index.view.php)
(page_1.php – its a very rudimentary html page…it has the <head>
, <body>
and thats it…its only for learning html/ css/ js/ php so obviously its low-level).
As you see, I made a separate PHP class file, customer.php, which i used it to create (in my page_1.php, an object, a Customer object. Also, this customer.php is required in index.php.
it works great …but i was wondering – why cant i define a simple, basic array, in that customer.php file…. !?
if i do…XAMPP throws errors!
But i can easily define arrays and do everything, in index.php file!
Thanks
To create a simple array in the customer.php file…but XAMPP throws errors.
(it works great in index.php!)
3