Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following will be based on your practice database, that you created during week 2 . After reading instructions, complete required steps: 1 . Create

The following will be 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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

1. How can evolutionary theory explain prosocial behaviour?

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago