Question
Part 1) For this assignment part 1, you will create a form and a PHP processor for it. The form will allow the user to
Part 1)
For this assignment part 1, you will create a form and a PHP processor for it.
The form will allow the user to select some styling options such as text color, font family, etc. (Include at least 3 style attributes.) The form will also contain a text area where the user can type a paragraph or more of text.
The form processor will use the styling selections to style the text typed in the text area and produce a page displaying the content of the text area. For simplicity, use an embedded style sheet to achieve this effect. The contents of this style sheet will be produced by PHP from the submitted form data.
Use a method that avoids relying on the form values being valid style attributes. In other words, for the form elements use your own choices for names, and then convert these to style attributes in the PHP.
For example, instead of having a form menu option whose value is Times Roman and inserting that value directly into the style sheet, give that option a name like times and have the PHP convert it to "Times Roman" for the style sheet.
You can have a static HTML form and a separate PHP processor script, or an all-in-one script that both generates the form and processes it.
Part 2)
Description
Your PHP code should display a calendar page. The top of the calendar states the day and time being displayed. The calendar is a table where the first column lists hours starting from the current hour to a final hour (where the final hour is the current hour + some number between 0 and 12). For example, if the time is now is 3.32 pm, the first hour should read 3.00 pm and the last hour is determined by a variable called hours_to_show. If hours_to_show is set at 12, then the last hour shown in the column should be 3.00 pm. The subsequent columns correspond to people. You should display a minimum of 3 or as many you prefer.
Directions
Please note the requirements are as follows the number of hours being displayed is set by a variable. Therefore this variable will be set to 12 at the start, however, this means that the number of rows in the table cannot be assumed to be known and you cannot simply write XHTML meaning not STATIC for 12 rows.
I have prepared a CSS file for you that you can use to style your calendar. You can get the CSS here. This is just for your convenience. You may choose to write your own CSS if you so desire. When using my CSS file please note that certain elements need to be given appropriate ids or classes. Please be aware to see what elements need to be given class or id labels.
General notes
Make sure that your file has correct permissions set. php files should have permissions set to 755 or if you prefer: -rwxr-xr-x. Which means that it should be: read for owner group and other and write for owner and execute for owner group and other.
For debugging purposes you can change the top line to be: #!/usr/local/bin/php -d display_errors=STDOUT and you will get error output on your document, which makes finding syntax errors much easier.
Requirements
Your program should be called calendar.php and should reside in your public directory along with a CSS file called callendar.css that styles it.
When your program is finished, create a text file called calendar.txt and copy and paste the contents of your calendar.php file into calendar.txt. Put calendar.txt in your public directory as well.
Your calendar must be generated by PHP script.
By default when your page is loaded it should display current day, date and time.
Your program must use a function called get_hour_string to get the hours for the first
column of the calendar table. This function takes a single argument of a timestamp and
returns a string indicating an hour. For example, the value returned might be: "8.00am".
The table is rendered by PHP the number of rows displayed is determined by a variable
hours_to_show, which you may set equal to 12. The rows should alternate in background color.
Make sure the following files are uploaded to your public_html
calendar.php
calendar.txt
calendar.css
As usual, place this assignment link on your home page.
directory.
Validate the output of your PHP program. Go to w3c's validator page and give the url of calendar.php and w3c will validate the resulting XHTML.
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