Part 1:Choose one of the following topics. 1. Use examples to show how to use theprintffunction.(This topic is limited to 4 initial posts.) 2. Use examples to show how to use thedateandtimefunction...

1 answer below »
Part 1:Choose one of the following topics.

1. Use examples to show how to use theprintffunction.(This topic is limited to 4 initial posts.)


2. Use examples to show how to use thedateandtimefunction with various formats.


3. Uploading files to a web server is a common task in web development. What are the important procedures inuploading files to the server?


4. Discuss the use of text field and password field in a web form. (This topic is limited to 2 initial posts.)


5. Discuss the use of radio buttons and checkboxes in a web form.(This topic is limited to 2 initial posts.)


6. How are drop-down lists used in a web form? How to pass multiple values to the server?


7. What are the advantages and disadvantages of using the GET method and the POST method.


Part 2:


See the attachment.






Microsoft Word - JL_BCS350_201_Module4_programming assignment (hw3).docx BCS 350: Web Database Development CRN 24518 JL Spring 2020 ------------------------------------------------------------------------------------------------------------------------------ Programming Assignment 3 ------------------------------------------------------------------------------------------------------------------------------ Objectives: To acquaint you with PHP file handling, HTML forms, arrays, strings, and control structures. Tasks: You will write a web application that helps user create a profile. A user profile contains user’s first name, last name, email, class standing, school information, extra information, program and other information, and profile picture. The application uses a web form to allow user to enter and submit personal information and upload a profile photo. It then processes user input and displays user profile information and photo on a new page. You are expected to create two files: hw3_form.html and hw3_process.php. The assignment must meet the following specifications: The file hw3_form.html generates a webpage as shown in Figure 1. The page uses various input types to allow user to enter and submit personal information and allows user to upload a profile photo. After user submits the form, hw3_process.php sanitizes user input, displays the user’s profile information and photo on a web page as shown in Figure 2. 1) The first name, last name, and email fields are required (see Figure 3). 2) The class standing uses a drop-down list and allows a single selection from four options: Freshman, Sophomore, Junior, and Senior. The default selection for class standing is “Freshman”. 3) The school information uses radio buttons to allow a single selection from four options: School of Arts & Sciences, School of Business, School of Engineering Technology, and School of Health Sciences. The default selection for school information is “School of Arts & Sciences”. 4) The extra information uses check boxes to allow zero to multiple selections from three options: Veteran, Transfer Student, and International Student. The extra information is optional. If the user doesn’t select anything, display “You did not enter any extra information” (see Figure 4). 5) The program and other information allows multiple-line input and is optional. If the user doesn’t enter anything, display “You did not enter any program and other information” (see Figure 4). 6) The time, day of the week, and date information when the profile is created should be displayed in the format as shown in Figure 2. 7) The form has a file input to allow user to browse the computer and select a file to upload. If the user doesn’t upload a file, display “No file has been uploaded” (see Figure 4). If the image file is not a JPG, GIF, PNG or TIF file, show the filename and display that the file is not an accepted file (see Figure 5). 8) The form has a Submit button to submit form data and a Reset button to clear up the form data. 9) The input entered by the user, not from a list of predefined options, must be sanitized. These include input for first name, last name, email, and program and other information. Make a fieldset and place “BCS350 Assignment 3 - your name” on the top of both web pages. You are free to decide the styles of your pages. Submission: You must submit a ZIP file that includes two files named hw3_form.html and hw3_process.php through the assignment submission link on Blackboard. Do NOT use any other names for these files. Your submitted program should not contain any syntax errors. Please include the integrity statement “I certify that this submission is my own original work” with your name and RAM ID as comments in all your source files. Hints: 1. Use HTML input required attribute https://www.w3schools.com/tags/att_input_required.asp 2. Use the php empty function to check if an input field is empty. http://php.net/manual/en/function.empty.php 3. Use if ($_FILES['filename']['error']==0) to check whether a file is uploaded or not. 4. Use HTML table or

tag to format web content. 5. Use the following function to sanitize user input. function sanitizeString($var) { if (get_magic_quotes_gpc()) $var = stripslashes($var); $var = htmlentities($var); return $var; } Sample Output: Figure 1. HTML form for user input Figure 2. Display user profile photo and input. Figure 3. The user submits the form without filling out the required fields. Figure 4. User doesn’t enter extra information, program and other information, and doesn’t upload a file. Figure 5. User uploaded a file which is not acceptable image file.
Answered Same DayMar 06, 2021BCS350

Answer To: Part 1:Choose one of the following topics. 1. Use examples to show how to use...

Arun Shankar answered on Mar 07 2021
139 Votes
PHP Solution/hw3_form.html


BCS 350 - Assignment 3 -- Student Name


Create your profile


    
    First name        
        Last name        
        Email address:        
        Class standing:        
Freshman
Sophomore
Junior
Senior

        School:        
School of Arts & Sciences
School of Business
School of Engineering Technology
School of Health Sciences

        Extra        
Veteran
Transfer Student
International Student

        Program and other information
you like to share:        


        Upload your profile pic
(JPG, GIF, PNG or TIF file)        


        








PHP Solution/hw3_process.php
/*
This function is given by the Professor, and not coded by me.
*/
function sanitizeString($var)
{
    if (get_magic_quotes_gpc())
    $var = stripslashes($var);
    $var = htmlentities($var);
    return $var;
}
$fname = sanitizeString($_POST["customerFirstName"]);
$lname = sanitizeString($_POST["customerLastName"]);
$email = sanitizeString($_POST["customerEmail"]);
$class = $_POST["classStanding"];
$school = $_POST["school"];
$info = sanitizeString($_POST["programInfo"]);
$target_dir = "uploads/";
$target_file = $target_dir.basename($_FILES["myFile"]["name"]);
$uploadOk = 1;
$imageFileType =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here