Assignment - State with PHP *Html at end Required HTML code: lab8-1.html <!DOCTY
ID: 3865178 • Letter: A
Question
Assignment - State with PHP
*Html at end
Required HTML code:
lab8-1.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="scripts/validate.js"></script>
<!-- Password checking script here!! -->
</head>
<body>
<form method="post" action="newuser.php" id="mainForm" >
First Name:<br>
<input type="text" name="firstname" id="firstname" class="required">
<br>
Last Name:<br>
<input type="text" name="lastname" id="lastname" class="required">
<br>
Username:<br>
<input type="text" name="username" id="username" class="required">
<br>
email:<br>
<input type="text" name="email" id="email" class="required">
<br>
Password:<br>
<input type="password" name="password" id="password" class="required">
<br>
Re-enter Password:<br>
<input type="password" name="password-check" id="password-check" class="required">
<br><br>
<input type="submit" value="Create New User">
</form>
</body>
lab8-4.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="scripts/validate.js"></script>
</script>
</head>
<body>
<form method="post" action="finduser.php" id="mainForm" >
Username:<br>
<input type="text" name="username" id="username" class="required">
<br>
<br><br>
<input type="submit" value="Find User">
</form>
</body>
userimagesddl.sql
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 16, 2017 at 11:59 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `lab8`
--
-- --------------------------------------------------------
--
-- Table structure for table `userImages`
--
CREATE TABLE `userImages` (
`userID` int(11) NOT NULL,
`contentType` varchar(255) NOT NULL,
`image` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `userImages`
--
ALTER TABLE `userImages`
ADD PRIMARY KEY (`userID`),
ADD KEY `userID` (`userID`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `userImages`
--
ALTER TABLE `userImages`
ADD CONSTRAINT `userimages_ibfk_1` FOREIGN KEY (`userID`) REFERENCES `users` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 */;
Explanation / Answer
Required HTML
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="scripts/validate.js"></script>
<!-- Password checking script here!! -->
</head>
<body>
<form method="post" action="newuser.php" id="mainForm" >
First Name:<br>
<input type="text" name="firstname" id="firstname" class="required">
<br>
Last Name:<br>
<input type="text" name="lastname" id="lastname" class="required">
<br>
Username:<br>
<input type="text" name="username" id="username" class="required">
<br>
email:<br>
<input type="text" name="email" id="email" class="required">
<br>
Password:<br>
<input type="password" name="password" id="password" class="required">
<br>
Re-enter Password:<br>
<input type="password" name="password-check" id="password-check" class="required">
<br><br>
<input type="submit" value="Create New User">
</form>
</body>
lab8-4.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="scripts/validate.js"></script>
</script>
</head>
<body>
<form method="post" action="finduser.php" id="mainForm" >
Username:<br>
<input type="text" name="username" id="username" class="required">
<br>
<br><br>
<input type="submit" value="Find User">
</form>
</body>
userimagesddl.sql
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 16, 2017 at 11:59 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `lab8`
--
-- --------------------------------------------------------
--
-- Table structure for table `userImages`
--
CREATE TABLE `userImages` (
`userID` int(11) NOT NULL,
`contentType` varchar(255) NOT NULL,
`image` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `userImages`
--
ALTER TABLE `userImages`
ADD PRIMARY KEY (`userID`),
ADD KEY `userID` (`userID`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `userImages`
--
ALTER TABLE `userImages`
ADD CONSTRAINT `userimages_ibfk_1` FOREIGN KEY (`userID`) REFERENCES `users` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 */;