I’m trying to submit a form to a database using PHP and tried to load a .env file containing the database credentials using composer require vlucas/phpdotenv
and it gives me an error in my text editor undefined type DotenvDotenvDotenv
if i try to load the .env
file in the /src
file from the Database.php
file as seen in the repo. i’m also getting undefined variables
error for all the variables as used in during $form_data_db
assignment in handleForm.php
file. How can I make it all play nicely?
Here is the repository for the project https://github.com/Thebuilderekes/tw-php/tree/try-env
I expect that the credentials in the .env file are recognized form submits successfully to the database.