Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello, I'm new to php and the professor i have isnt good at teaching the class. I'm wondering if anyone can help me with the
Hello,
I'm new to php and the professor i have isnt good at teaching the class. I'm wondering if anyone can help me with the following problem. I created the entire html but i dont understand how to do the php at all. I will be great if anyone could help down below are all the instructions and examples on how its supposed to look.
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 6) The time, day of the week, and date information when the profile is created should be displayed 7) The form has a file input to allow user to browse the computer and select a file to upload. If the enter anything, display "You did not enter any program and other information" (see Figure 4) in the format as shown in Figure 2. 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. 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 names for these files. php through the assignment submission link on Blackboard. Do NOT use any other 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 ' ] -o) to check whether a file is uploaded or not. 4. Use HTML table ortag to format web content. 5. Use the following function to sanitize user input. function sanitizeString (var) if (get_magic_quotesgpc)) var - stripslashes (var); varhtmlentities ($var); return $vari Sample Output: Figure 1. HTML form for user input BCS350 Assignment 3 Student Name Create Your Profile First Name Last Name Email Class Standing reshman v School of Arts&Sciences School of Business School of Engineering Technology School of Health Sciences School Veteran Transfer Student International Student Extra: Program and Other Information you ike to share Upload your profile picture (JPG, GIF, PNG or TIF File) Choose File No file chosen Submit Reset Figure 2. Display user profile photo and input. BCS350 Assignment 3 -- Student Name Profile created at 8:12 pm, Friday, February 22, 2019. Welcome, Alice You profile information: First Name: Alice Last Name: Brown E-mail liceb@abc.com Standing: senion School: School of Business Extra: Extra: Veteran Transfer Student Program and Other Information: I am in the CPIS program. I like reading, music, and travel. I'm looking for an internship. Figure 3. The user submits the form without filling out the required fields. Create Your Profile First Name Last Name Email Class Standing Please fill out this field. School of Arts&Sciences O School of Business School School of Engineering Technology School of Health Sciences Figure 4. User doesn't enter extra information, program and other information, and doesn't upload a file. BCS350 Assignment 3 -- Student Name Profile created at 8:18 pm, Friday, February 22, 2019 Welcome, David No file has been uploaded. You profile information: First Name: David Last Name: Wi11iams E-mail: dw@xyz.com Standing: sophomore School: School of Engineering Technology You did not enter extra information You did not enter program and other information. Figure 5. User uploaded a file which is not acceptable image file. BCS350 Assignment 3 - Student Name Profile created at 8:23 pm, Friday, February 22, 2019 Welcome, Mike example7-16.php is not an accepted image file. You profile information: First Name: Mike Last Name: Peterson E-mail: mikep@xyz.com Standing: junior School: School of Arts & Sciences You did not enter extra information You did not enter program and other information. 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 6) The time, day of the week, and date information when the profile is created should be displayed 7) The form has a file input to allow user to browse the computer and select a file to upload. If the enter anything, display "You did not enter any program and other information" (see Figure 4) in the format as shown in Figure 2. 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. 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 names for these files. php through the assignment submission link on Blackboard. Do NOT use any other 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 ' ] -o) to check whether a file is uploaded or not. 4. Use HTML table ortag to format web content. 5. Use the following function to sanitize user input. function sanitizeString (var) if (get_magic_quotesgpc)) var - stripslashes (var); varhtmlentities ($var); return $vari Sample Output: Figure 1. HTML form for user input BCS350 Assignment 3 Student Name Create Your Profile First Name Last Name Email Class Standing reshman v School of Arts&Sciences School of Business School of Engineering Technology School of Health Sciences School Veteran Transfer Student International Student Extra: Program and Other Information you ike to share Upload your profile picture (JPG, GIF, PNG or TIF File) Choose File No file chosen Submit Reset Figure 2. Display user profile photo and input. BCS350 Assignment 3 -- Student Name Profile created at 8:12 pm, Friday, February 22, 2019. Welcome, Alice You profile information: First Name: Alice Last Name: Brown E-mail liceb@abc.com Standing: senion School: School of Business Extra: Extra: Veteran Transfer Student Program and Other Information: I am in the CPIS program. I like reading, music, and travel. I'm looking for an internship. Figure 3. The user submits the form without filling out the required fields. Create Your Profile First Name Last Name Email Class Standing Please fill out this field. School of Arts&Sciences O School of Business School School of Engineering Technology School of Health Sciences Figure 4. User doesn't enter extra information, program and other information, and doesn't upload a file. BCS350 Assignment 3 -- Student Name Profile created at 8:18 pm, Friday, February 22, 2019 Welcome, David No file has been uploaded. You profile information: First Name: David Last Name: Wi11iams E-mail: dw@xyz.com Standing: sophomore School: School of Engineering Technology You did not enter extra information You did not enter program and other information. Figure 5. User uploaded a file which is not acceptable image file. BCS350 Assignment 3 - Student Name Profile created at 8:23 pm, Friday, February 22, 2019 Welcome, Mike example7-16.php is not an accepted image file. You profile information: First Name: Mike Last Name: Peterson E-mail: mikep@xyz.com Standing: junior School: School of Arts & Sciences You did not enter extra information You did not enter program and other information
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