Answered step by step
Verified Expert Solution
Link Copied!

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 2. After reading instructions, complete required steps:
1. 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.
2. Create a file called controllers/list_customers.php. This file should:
- Define a function called list_customers() that retrieves all customers from the customers table and returns them as an array.
- Load the views/list_customers.php file and pass the array of customers to it.
3. Create a file called controllers/add_customer.php. This file should:
- Define a function called add_customer() that retrieves the customer data from the POST request and inserts it into the customers table.
- Redirect the user to the list_customers.php page.
4. Create a file called views/list_customers.php. This file should:
- Loop through the array of customers passed to it and display their information in a table.
5. Create a file called views/add_customer.php. This file should:
- Display a form that allows the user to enter the customer's information and submit it to the add_customer() function in the controllers/add_customer.php file.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions