Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following is based on your practice database, that you created during week 2 . After reading instructions, complete required steps: 1 . Create a
The following is based on your practice database, that you created during week After reading instructions, complete required steps:
Create a file called index.php that will act as the entry point for our application. This file should:
Establish a database connection to the practice database on localhost.
Determine which controller to load based on the request URL.
Call the appropriate method on the controller based on the request URL.
Output the result of the method to the browser.
Create a file called controllerslistcustomers.php This file should:
Define a function called listcustomers that retrieves all customers from the customers table and returns them as an array.
Load the viewslistcustomers.php file and pass the array of customers to it
Create a file called controllersaddcustomer.php This file should:
Define a function called addcustomer that retrieves the customer data from the POST request and inserts it into the customers table.
Redirect the user to the listcustomers.php page.
Create a file called viewslistcustomers.php This file should:
Loop through the array of customers passed to it and display their information in a table.
Create a file called viewsaddcustomer.php This file should:
Display a form that allows the user to enter the customer's information and submit it to the addcustomer function in the controllersaddcustomer.php file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started