Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PHP web application that accepts input from a user and provides output based on the values input. The purpose of this exercise is to: Learn

PHP web application that accepts input from a user and provides output based on the values input.

The purpose of this exercise is to:

  • Learn how to connect a PHP application to a MySQL database
  • Learn how to retrieve and display data from a MySQL database

The image of the user_list.php code file to create and run a web application using Visual Studio Code.

You will add fields for the user's address. The address fields must include the following:

  • Street Address (up to 100 characters)
  • City (up to 25 characters)
  • State (2 characters)
  • Zip Code (10 characters)

Updates must include:

  • Ability to store these fields in the database (fields should not be nullable)
  • Display of these fields in the user information grid on the web page
  • Entry boxes for these fields

I want the code of this - adding street address, city, state, zip code for PHP web application.image text in transcribedimage text in transcribedimage text in transcribed

user_list.php code: kl?php //Connect to Database $hostname = "localhost"; $username = "ecpi_user"; $password = "Password1"; $dbname = "cis224_wk3gp"; $conn = mysqli_connect($hostname, $username, $password, $dbname); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 1/Query for all users $query = "SELECT * FROM userinfo"; $result = mysqli_query($conn, $query); ? Week3 GP1 - Your Name I

Current Users:

50 51 52 53 54 55 56 57 58 59 60 61 62
User # First Name Last Name E-Mail Favorite Number
Listen for XDe 23 ... input_output.php X {} launch.json input_output.php > html > head > form V VARIABLES 10 PidVUIILE V WATCH 1/Retrieve values from query string and store in a local variable //as long as the query string exists (which it does not on first //loas of a page) if (isset($_POST['fname'])) $first_name = $_POST['fname']; If (isset($_POST[ 'Iname'])) $last_name = $_POST['name']; if (isset($_POST['email'])) $email = $_POST['email']; if (isset($_POST['fav_num'])) $favorite = $_POST['fav_num']; I $first_name: not available $last_name: not available $email: not available $favorite: not available 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 //Display the values eneterd as long as there is a value there if (strlen($first_name) > O || strlen($last_name) > 0) echo "

The name you entered is: $first_name $last_name

"; if (strlen($email) > 0) echo "

The email addres you gave is: $email

"; if (strlen($favorite) > 0) if (is_numeric($favorite)) echo "

You said your favorite number is: $favorite

"; else echo "

That's not a number!

"; ?

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

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

How do books become world of wonder?

Answered: 1 week ago