How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask TheDoctor Your Own Question
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience:  M.S. in Internet Information Systems
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

Display the guestbook form. This form will have four input

This answer was rated:

Display the guestbook form. This form will have four input fields and a submit button. The first three input fields should collect a name, a location and an e-mail address. The fourth should be a multi-line textarea for collecting user comments.
Process the submission of the form. This processing should begin with validating the user’s input as follows:
The name, location and e-mail fields are required. Give an error message to this effect if any of them are empty or contain only spaces.
The name and location fields should contain at least a two-character value, once leading and trailing spaces have been trimmed. Give an error message to this effect if either field violates this requirement.
The e-mail field must contain an “at sign” (@) to be considered valid. There are certainly more thorough ways to validate an e-mail address, but simply checking for an at sign will be sufficient for this assignment. Produce an error message if someone tries to submit an invalid e-mail address.
If any of these requirements are not met, you should give a list of as many applicable error messages as possible and redisplay the form with the user’s previous input included. The user should be able to see the form (with their previous input) and the error messages together on one page.

If all the validation requirements are met, the processing should proceed by sanitizing the four input values by converting the HTML reserved characters to their equivalent character entities (using the function discussed in class) and stripping out all pipe characters (|). The comments field requires additional sanitization. For the comments field only, you should insert a
element before each newline and then strip out all newlines and carriage returns.

Once sanitized, the data fields should be concatenated into a single string with the fields separated by pipe characters (|) and a newline at the end. The resulting string should be appended to a file named guestbook.txt in your ~/data directory on the server. Be sure to use file locking when performing the write. If any error occurs during the file access, notify the user accordingly. Otherwise, upon success, thank the user for signing the guestbook.
Display the contents of the guestbook. All pages produced by the application (except the one showing the guestbook) should contain a link that allows the user to view the contents of the guestbook. Study the HTML source code of the sample solution to see how this link can insert an element into the $_GET array so you can detect it within your PHP controller.

When displaying the guestbook use a single HTML table. Read each line of the ~/data/guestbook.txt file individually and break it apart at the pipe character delimiters. Generate two rows of the table for each line of the file. The first row should contain three table header cells—one for the name, one for the location, and one for the e-mail address, in that order. The second row should contain a single table data cell (spanning three columns) for the comments. Use some CSS to make this table look a bit nicer than the defaults. At the bottom of this page, display a link that will allow the user to return to the form used to sign the guestbook.
Hi, I'm a Moderator for this topic. I've been working hard to find a Professional to assist you right away, but sometimes finding the right Professional can take a little longer than expected.

I wonder whether you're ok with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, feel free to let me know and I will cancel this question for you. Thank you!
Customer: replied 4 years ago.

i cannot wait much longer. If someone can assist me asap that would be great, else i want to cancel this question and want my money back.



Thank you for your continued patience. We will continue the search for a Professional for you.
Customer: replied 4 years ago.

Thanks. But please make it really urgent for me this is the first time i ever asked a question and i wanted to leave a good feedback on this website.

Hello and thank you for using JustAnswer. It would be my pleasure to assist you with this.

Generally, projects that require this level of effort are priced quite a bit higher. This is a few hours of work and the current question value is extremely low given that level of effort. If this were a quick, 15 minute response, then the value would be fine. But again, this will require a few hours of work.

If you increased the question value to $45, that would be fair. I will submit an under-priced report. You will receive an email that gives you further information about updating the question value.

Thank you
Customer: replied 4 years ago.

no i am all set i cant afford to increase the price. I already been delayed for sending this assignment. I need my money back at this time. The reply was so late.

I apologize for the delay. The professionals on this site do not work for JustAnswer. That others did not reply earlier was likely partly due to the low value of the question. Again, it is significantly lower than what is commonly offered for this level of effort.

I just now saw your question, or I would have contacted you sooner. While I was waiting for your reply, I actually completed your assignment. Let me know if you would like it. There is no need to increase the question value since you waited so long.


In the future, you can get fast service for web development related questions like this by requesting me directly. Simply start your questions with **For TheDoctor** and I will make certain that you get a reply in a much more reasonable time.


Again, please let me know if you would like me to upload your completed assignment. I have it ready for you.

Customer: replied 4 years ago.

So u r saying that the amount i paid is fine for now cauz i waited for long. If thats the case sure i can have the answer.


You need to spend $3 to view this post. Add Funds to your account and buy credits.
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience: M.S. in Internet Information Systems
TheDoctor and 3 other Homework Specialists are ready to help you