NerdieLuv Dating Web Project



This assignment is about making a simple multi-page "online dating" site that processes HTML forms with PHP. Online dating has become mainstream with popular sites such as eHarmony, Match.com, OkCupid, Chemistry, and Plenty of Fish. Your task for this assignment is to write HTML and PHP code for a fictional online dating site for desperate single geeks, called Nerdieluv. Turn in the following files:


• index.php, a front page that links to the other page (provided as an image)


• signup.php, a page with a form that the user can use to sign up for a new account


• signup-submit.php, the page that receives data submitted by signup.php and signs up the new user


• matches.php, a page with a form for existing users to log in and check their dating matches


• matches-submit.php, the page that receives data submitted by matches.php and show's the user's matches


• common.php, a file containing any common code used by the above pages


There are some provided files on the web site. The first is a mostly complete image screen/shot version of the site's front page, index.php. We also provide a complete CSS file nerdieluv.css with all of the page styles. Link to this CSS file from all of your pages and use its styles in your code. You can fully style all pages using the styles in nerdieluv.css only.


The image of index.php has a header/footer and links to signup.php and matches.php. This file's contents are complete, but large parts of it are repeated on other pages. The repeated parts should be turned into functions in common.php that are called by each page. The "Sign up" link leads to signup.php (left below), and "Check matches" to matches.php (right below):


The details about each page's contents and behavior are described on the following pages.


Screenshots in this document are from Windows in Firefox, which may differ from your system. Sign-Up Page (signup.php): The signup.php page has a header logo, a form to create a new account, and footer notes/images. You must write the HTML code for the form. The form contains the following labeled fields:


• Name: A 16-character box for the user to type a name.


• Gender: Radio buttons for the user to select a gender of Male or Female. When the user clicks the text next to a radio button, that button should become checked. Initially Female is checked.


• Age: A 6-letter-wide text input box for the user to type his/her age in years. The box should allow typing up to 2 characters.


• Personality type: A 6-character-wide text box allowing the user to type a Keirsey personality type, such as ISTJ or ENFP. The box should let the user type up to 4 characters. The label has a link to http://www.humanmetrics.com/cgi-win/JTypes2.asp .


• Favorite OS: A drop-down select box allowing the user to select a favorite operating system. The choices are Windows, Mac OS X, and Linux. Initially "Windows" is selected.


• Seeking age: Two 6-character-wide text boxes for the user to specify the range of acceptable ages of partners. The box should allow the user to type up to 2 characters in each box. Initially both are empty and have placeholder text of "min" and "max" respectively. When the user starts typing, this placeholder text disappears.


• Sign Up: When pressed, submits the form for processing as described below. Submitting the Sign-Up Form (signup-submit.php):


When the user presses "Sign Up," the form should submit its data as a POST to signup-submit.php. (The exact names and values of the query parameter(s) are up to you.) your PHP code should read the data from the query parameters and store it as described below. The resulting page has the usual header and footer and text thanking the user. The text "log in to see your matches!" links to matches.php. Your site's user data is stored in a file singles.txt, placed in the same folder as your PHP files. We will provide you an initial version of this file. The file contains data records as lines in exactly the following format, with the user's name, gender (M or F), age, personality type, operating system, and min/max seeking age, separated by commas:


Your signup-submit.php code should create a line representing the new user's information and add it to the end of the file. See the PHP file_put_contents via w-3 schools or any reasonable online source. You will have to add a line break (\n) after each line of data that you add to the file.


In all pages, assume valid data for the file's contents and form submissions. For example, no fields will be left blank or contain illegal characters (such as a comma). No user will resubmit data for a name already in the system.


View Matches Page (matches.php): The matches.php page has a header logo, a form to log in and view the user's matches, and footer notes/images. You must write the HTML for the form. The form has one field:


• Name: A label and 16-letter box for the user to type a name.

Initially empty. Submit to the server as a query parameter name.

When the user presses "View My Matches," the form submits its data as a GET request to matches-submit.php. The name of the query parameter sent should be name, and its value should be the encoded text typed by the user. For example, when the user views matches for Rosie O Donnell, the URL should be:


• matches-submit.php?name=Rosie+O+Donnell


Viewing Matches (matches-submit.php):


When viewing matches for a given user, matches-submit.php should show a central area displaying each match. Write PHP code that reads the name from the page's name query parameter and finds which other singles match the given user. The existing singles to match against are records found in the file singles.txt as described previously. You may assume that the name parameter is passed and will be found in the file. Below the banner should be a heading of "Matches for (name)". Below this is a list of singles that match the user. A "match" is a person with all of the following qualities:


• The opposite gender of the given user;


• Of compatible ages; that is, each person is between the other's minimum and maximum ages, inclusive;


• Has the same favorite operating system as this user;


• Shares at least one personality type letter in common at the same index in each string. For example, ISTP and ESFP have 2 in common (S, P). As you find each match, output the HTML to display the matches, in the order they were originally found in the file. Each match has the image user.jpg, the person's name, and an unordered list with their gender, age, personality type, and OS.


Pages of NerdieLuv

• index.php

• signup.php

• signup-submit.php

• matches.php

• matches-submit.php

• common.php


About The Project


One of the main purposes of dating is for two or more people to evaluate one another's suitability as a long term companion or spouse. Often physical characteristics, personality, financial status, and other aspects of the involved persons are judged and, as a result, feelings can be hurt and confidence shaken.



Built With

  1. HTML

  2. CSS

  3. PHP


Output






Contact us for this PHP assignment Solutions by Codersarts Specialist who can help you mentor and guide for such PHP assignments.


If you have project or assignment files, You can send at contact@codersarts.com directly

20 views0 comments