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 3 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 3 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 3 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 3 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 6 other Homework Specialists are ready to help you

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Previous | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX

Meet The Experts:

  • LogicPro



    Satisfied Customers:

    Expert in Java C++ C C# VB Javascript Design SQL HTML
< Last | Next >
  • LogicPro's Avatar



    Satisfied Customers:

    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany


    Satisfied Customers:

    More than 5000 online tutoring sessions.
  • Linda_us's Avatar


    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    Post Graduate Diploma in Management (MBA)
  • Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    Experience with chartered accountancy
  • Bizhelp's Avatar



    Satisfied Customers:

    Bachelors Degree and CPA with Accounting work experience
  • Seanna's Avatar



    Satisfied Customers:

    3,000+ satisfied customers, all topics, A+ work

Related Homework Questions