What is the answer for Lab 6 in SDEV 300 Class?

User Generated

UREAnzr

Programming

Description

As part of the submission for this Lab, you will create a simple e-Commerce supports displaying, adding, updating and deleting products from a database that are part of products in your store. Specifically, all product data must be organized in one or more MySQL tables. In addition, you will need to store your customer data as they order from your store.
Your product data should be dynamic allowing the ability for the store owner to insert new products, update existing products, delete existing products and list all available products. When designing your application, be sure to use prepared statements to minimize SQL injection. Also, make sure your Forms flow logically within your application and are presented in an attractive easy-to-use Web interface.
Create screen captures showing the successful running your application. Each screen capture should be fully described.
For your deliverables, you should submit a zip file containing your word document (or PDF file) with screen shots of the application running successfully along with your SQL script file.

Unformatted Attachment Preview

LAMP Apps Overview This lab walks you through using Linux, Apache, MySQL and PHP (LAMP) to create simple, yet very powerful PHP applications connected to a MySQL database. For developers using Windows, the acronym becomes WAMP (Linux is replaced by Windows). The basics of inserting, updating, deleting and selecting from MySQL using PHP forms will be provided. Some “bad” security practices that lead to SQL injection vulnerabilities will be exposed as well as some techniques to mitigate these issues. Learning Outcomes: At the completion of the lab you should be able to: 1. 2. 3. 4. Insert data into a MySQL database using PHP forms Query existing data in a MySQL database using PHP forms Delete data from a MySQL database using PHP forms Update data in a MySQL database using PHP forms Lab Submission Requirements: After completing this lab, you will submit a word (or PDF) document that meets all of the requirements in the description at the end of this document. In addition, your LAMP application and all associated files should be submitted. Virtual Machine Account Information Your Virtual Machine has been preconfigured with all of the software you will need for this class. The default username and password are: Username : umucsdev Password: umuc$d8v MySQL Username: sdev_owner MySQL password: sdev300 MySQL database: sdev Part 1 – Insert data into a MySQL database using PHP forms In this exercise we will create a small table in MySQL and then use a PHP form to insert collected from the user into the form. We will first use a technique very susceptible to SQL injection and then a better approach using prepared statements. 1. Assuming you have already launched and logged into your SDEV32Bit Virtual Machine (VM) from the Oracle VirtualBox, pen up the terminal by clicking on the terminal icon. 1 2. To start the MySQL database type the following the terminal prompt: mysql -u sdev_owner -p When prompted for the password enter sdev300 2 3. To display the available databases type the following at the mysql prompt: show databases; 4. The database we will be using for this course is sdev. To use this database, type the following at the mysql prompt: use sdev; 3 5. To display the current tables in the sdev database, type the following command at the mysql prompt: show tables; You may already have some tables in your database. If so, the names of those tables would be displayed. If not, you would see Empty set as illustrated above. 6. Create a Students table in the SDEV database, if one does not already exist: use sdev; // Create a student table CREATE TABLE Students ( tychoName varchar(30) primary key, firstName varchar(30), lastName varchar(30), eMail varchar(60) ); 7. Next, we will create the PHP code that will provide an HTML form and response for entering data into the database table from the form. Type, or copy and paste from the code examples, the following code into your text editor and save as InsertApp.php. This code has many components including the use of PHP classes, reading parameters from files and other functionality. The code is relative long and may take some experimentation and analysis for full understanding. You should review and tinker with all aspects of the code to become comfortable with the functionality. 4 Create Student Complete the information in the form below and click Submit to create your account. All fields are required. Firstname:
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

At...


Anonymous
I was struggling with this subject, and this helped me a ton!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags