Question
Part 1 (10 points) Modify the Index.php file to check for duplicate email addresses. Create a new project and use the attached files to verify
Part 1 (10 points)
Modify the Index.php file to check for duplicate email addresses. Create a new project and use the attached files to verify your code. You will probably need to do a slight change on the attached files such as changing database name.
Submit:
modified Index.php file Screen shot of the messages when processing email addresses on the board. Note that for checkuser.sql, you only need to import the file inside PhpMyAdmin or MySQL Workbench. The database and table should be automatically created for you.
Part 2 (10 points):
add one file and call it view_users.php.
Your new page should display the names of all registered users and their email addresses. Each user is displayed on a separate line.
Submit:
view_users.php
I would copy and paste every picture
THIS IS THE PICTURE WITH THE NAME "checkusers.sql"
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 05, 2019 at 02:32 AM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.3.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `cs251quiz` -- CREATE DATABASE IF NOT EXISTS `cs251quiz` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `cs251quiz`; -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `wuusers`; CREATE TABLE IF NOT EXISTS `wuusers` ( `u_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, `first_name` varchar(20) NOT NULL, `last_name` varchar(40) NOT NULL, `email` varchar(60) NOT NULL, `pass` char(40) NOT NULL, `registration_date` datetime NOT NULL, PRIMARY KEY (`u_id`) ) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `wuusers` (`u_id`, `first_name`, `last_name`, `email`, `pass`, `registration_date`) VALUES (1, 'Larry', 'Ullman', 'email1@example.com', 'e727d1464ae12436e899a726da5b2f11d8381b26', '2019-03-31 21:47:57'), (2, 'Zoe', 'Isabella', 'email4@example.com', '6b793ca1c216835ba85c1fbd1399ce729e34b4e5', '2019-03-31 21:47:57'), (3, 'John', 'Lennon', 'johnl@beatles.com', '2a50435b0f512f60988db719106a258fb7e338ff', '2019-03-31 21:47:58'), (4, 'Paul', 'McCartney', 'paulm@beatles.com', '6ae16792c502a5b47da180ce8456e5ae7d65e262', '2019-03-31 21:47:58'), (5, 'George', 'Harrison', 'georgeharrison@beatles.com ', '1af17e73721dbe0c40011b82ed4bb1a7dbe3ce29', '2019-03-31 21:47:58'), (6, 'Ringo', 'Starr', 'ringer@beatles.com', '520f73691bcf89d508d923a2dbc8e6fa58efb522', '2019-03-31 21:47:58'), (7, 'David', 'Jones', 'dave@monkees.com', 'ec23244e40137ef72763267f17ed6c7ebb2b019f', '2019-03-31 21:47:58'), (9, 'Micky', 'Dolenz', 'mick@monkees.com ', '0599b6e3c9206ef135c83a921294ba6417dbc673', '2019-03-31 21:47:58'), (10, 'Mike', 'Nesmith', 'mike3@monkees.com', '804a1773e9985abeb1f2605e0cc22211cc58cb1b', '2019-03-31 21:47:58'); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
THE NEXT ONE HERE IS THE FILE CALLED "index.php"
0){ $errors[] = 'That email is already in use'; } else{ $e = mysqli_real_escape_string($dbc, trim($_POST['email'])); $errors[] = 'The email address is not in use!'; } } //------------------------------------------------------------------------------------- // Report the errors. echo 'Notifications!
The following issues exist:
'; foreach ($errors as $msg) { // Print each error. echo " - $msg
"; } } // End of the main Submit conditional. ?>Check Registration
___________________________________________________________________________________________
THIS IS THE ANOTHER FILE CALLED "mysqli_connect.php"
___________________________________________________________________________________________
CONFIRM ME IF IT IS BETTER THAN THE PHOTO
sarrors - errevels ut intethtice en erver crey. ur cheet for an can edineset Engut ablest a. Bateased reststate risis Aphp \& Seript 92 - cysiti_comnect-phy If set the databese access finfor ition os constantes mage If intion ching sarrors - errevels ut intethtice en erver crey. ur cheet for an can edineset Engut ablest a. Bateased reststate risis Aphp \& Seript 92 - cysiti_comnect-phy If set the databese access finfor ition os constantes mage If intion ching
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