language: Deutsch   Français   italiano   Español   Português   日本語   russian   arabic   norwegian   swedish   danish   Nederlands   finland   ireland   English  

Web Programming Step by Step, Section 4 (Complaint Letter Generator)

Web Programming Step by Step Discussion Section 4: Complaint Letter Generator Basic PHP section idea and code by Stefanie Hatcher; contributions by Brian Le

This section is about HTML forms and processing form data in PHP.

Buggy HTML form:

The following HTML form has several mistakes that causes it not to submit its data correctly, as well as some poor design choices that make it unpleasant to the user. Look at the form, find the bug(s), and correct the problems.

buggy form page Complaint Letter Generator (inspired by Scott Pakin's Complaint Generator ):

Write an HTML form that allows the user to generate complaint letters. The user will specify the first/last name of the person to complain about, the person's gender, and how many sentences of complaints to generate. The following should be the appearance of your form:

Start from the following skeleton:

complaint.html

Test your form by having it initially submit its data to the following URL:

http://webster.cs.washington.edu/params.php

Once your form submits properly, write a PHP page letter.php on the server to process this form data. Start from the following skeleton:

letter.php

On the server there is a file sentence.txt containing a bunch of complaint sentences. Your PHP code should read this file, randomly pick sentences from it, and turn these into a complaint letter. The file has one sentence per line, such as:

_FNAME_ only wants to dominate or intimidate others. It's knowledge that _HESHE_ recently claimed that truth is merely a social construct. No matter what terms are used, _NAME_ is unconstrained by conscience.

You will need to personalize the letter by inserting the person's name and other information into it. The following are the patterns you will need to replace:

_FNAME_  : person's first name _LNAME_  : person's last name _NAME_   : person's full name _HESHE_  : he (male) or she (female) _HIMHER_ : him (male) or her (female) _HISHER_ : his (male) or her (female)

You can u hexrlpct. moncler jackets outletse the str_replace function to help you replace the above patterns in the text. If you write the code correctly, you can do this with a single call. When you're finished with your page, it should look like the following:

Your finished code might look like the following sample solution, written by Stefanie Hatcher:

complaint.html | letter.php Runnable solution Basic Validation:

If you finish all of the above work and have time left, try to add some basic server-side validation to your form. If the user submits an empty first or last name, you should print an error message rather than creating a complaint letter.


complaint letter generator

moncler sale nordstrom
outlet moncler new york
moncler mens acorus jacket black
moncler jackets
moncler womens designer shoes A complaint letter to ATOT Discussion in ' Off Topic ' started by preslove , Aug 6, 2004 .

Page 1 of 2 1 2 Next > preslove Lifer Joined: Sep 10, 2003 Messages: 16,679 Likes Received: 39 Apparently, someone dislikes this forum alot. Text   #1 preslove , Aug 6, 2004 AgaBoogaBoo Lifer Joined: Feb 16, 2003 Messages: 26,096 Likes Received: 0 Complaints about OP   #2 AgaBoogaBoo , Aug 6, 2004 mugs Lifer Joined: Apr 29, 2003 Messages: 48,897 Likes Received: 3 Bah   #3 mugs , Aug 6, 2004 BigJ Lifer Joined: Nov 18, 2001 Messages: 21,338 Likes Received: 0 Why do you have a complaint about me on your Web page? I get asked this question a lot. The short answer is: I don't. What you just read is the output of Scott Pakin's Automatic Complaint-Letter Generator, a program I wrote that randomly generates complaint letters on demand. The idea is that someone -- almost certainly whoever pointed you to my page -- entered "ATOT" into the Automatic Complaint-Letter Generator form at http://www.pakin.org/complaint. The result was the rambling but (I hope) grammatically correct complaint letter of the type you just read. It's intended to be funny, but apparently, some people don't share my sense of humor. That's why I wrote this page explaining my program.   #4 BigJ , Aug 6, 2004 calvinbiss Golden Member Joined: Apr 5, 2001 Messages: 1,746 Likes Received: 0 i'm not reading either of those things   #5 calvinbiss , Aug 6, 2004 Encryptic Diamond Member Joined: May 21, 2003 Messages: 8,886 Likes Received: 0 Originally posted by: BigJ Why do you have a complaint about me on your Web page? I get asked this question a lot. The short answer is: I don't. What you just read is the output of Scott Pakin's Automatic Complaint-Letter Generator, a program I wrote that randomly generates complaint letters on demand. The idea is that someone -- almost certainly whoever pointed you to my page -- entered "ATOT" into the Automatic Complaint-Letter Generator form at http://www.pakin.org/complaint. The result was the rambling but (I hope) grammatically correct complaint letter of the type you just read. It's intended to be funny, but apparently, some people don't share my sense of humor. That's why I wrote this page explaining my program. Click to expand... I figured it had to be a complaint generator after I read the two links posted already. Cute, but a bit wordy...   #6 Encryptic , Aug 6, 2004 preslove Lifer Joined: Sep 10, 2003 Messages: 16,679 Likes Received: 39 Damnit, cant you guys play along? Oh, and AgaBooga, here's yours   #7 preslove , Aug 6, 2004 rudder Lifer Joined: Nov 9, 2000 Messages: 19,365 Likes Received: 59 Cliff Notes?   #8 rudder , Aug 6, 2004 MBony Platinum Member Joined: Sep 16, 2003 Messages: 2,990 Likes Received: 0 Is that the same dude? He had that much beef w/ 2 different forums? Or is one a particular person? Either way, he/she has WAY too much time on their hands to write out that diatribe.   #9 MBony , Aug 6, 2004 CPA Elite Member Joined: Nov 19, 2001 Messages: 30,326 Likes Received: 2 Someone has a complaint about women! Oh my!   #10 CPA , Aug 6, 2004 Chaotic42 Lifer Joined: Jun 15, 2001 Messages: 31,563 Likes Received: 248 That's about 40% useless filler words.   #11 Chaotic42 , Aug 6, 2004 Kadarin Lifer Joined: Nov 23, 2001 Messages: 44,310 Likes Received: 5 Originally posted by: Chaotic42 That's about 40% useless filler words. Click to expand... I think 40% is a low estimate.   #12 Kadarin , Aug 6, 2004 Trey22 Diamond Member Joined: Oct 31, 2003 Messages: 5,530 Likes Received: 0 Cliff notes? ... too lazy to read through two letters! Bah, just noticed the whole complain letter generator thing.   #13 Trey22 , Aug 6, 2004 Yo Ma Ma Lifer Joined: Jan 21, 2000 Messages: 11,635 Likes Received: 1 Text (Not complaining though, it's an oldie but a goodie.)   #14 Yo Ma Ma , Aug 6, 2004 xcript Diamond Member Joined: Apr 3, 2003 Messages: 8,254 Likes Received: 0 :thumbsdown:   #15 xcript , Aug 6, 2004 brtspears2 Diamond Member Joined: Nov 16, 2000 Messages: 8,658 Likes Received: 1 Originally posted by: Trey22 Cliff notes? ... too lazy to read through two letters! Bah, just noticed the whole complain letter generator thing. Click to expand... It's a joke! Anyways I stand that anyone that can't read something longer than a few sentences, don't even read at all.   #16 brtspears2 , Aug 6, 2004 SilentRavens Senior member Joined: Aug 20, 2003 Messages: 666 Likes Received: 0 Originally posted by: Astaroth33 Originally posted by: Chaotic42 That's about 40% useless filler words. Click to expand... I think 40% is a low estimate. Click to expand... More like 80%.   #17 SilentRavens , Aug 6, 2004 datalink7 Lifer Joined: Jan 23, 2001 Messages: 16,762 Likes Received: 5 Originally posted by: CPA Someone has a complaint about women! Oh my! Click to expand... No one does. Nevertheless, if we contradict Women, we are labelled gin-swilling windbags. If we capitulate, however, we forfeit our freedoms Click to expand... LMAO   #18 datalink7 , Aug 6, 2004 JoPh Diamond Member Joined: Aug 8, 2002 Messages: 7,313 Likes Received: 1 hehe   #19 JoPh , Aug 6, 2004 Skel Diamond Member Joined: Apr 11, 2001 Messages: 5,354 Likes Received: 88 Originally posted by: rudder Cliff Notes? Click to expand...   #20 Skel , Aug 6, 2004 preslove Lifer Joined: Sep 10, 2003 Messages: 16,679 Likes Received: 39 AH ha! I knew I would get some people Oh and the woman one actually was good when I clicked it: Fact: Women's jeremiads reek of so much particularism that the smell makes me nauseated. Fact: The ripples of reaction to Women's viewpoints have spread, giving rise to universal calls to reveal some shocking facts about Women's lamentations. Fact: It's hard to fathom just how unscrupulous Women is. Click to expand... ROFL!   #21 preslove , Aug 6, 2004 neutralizer Lifer Joined: Oct 4, 2001 Messages: 11,552 Likes Received: 0 That's cute, but I realized it was fake when I realized the letter made NO sense whatsoever with regard to ATOT.   #22 neutralizer , Aug 6, 2004 Guest R   #23 , Aug 6, 2004 farmercal Golden Member Joined: Mar 23, 2000 Messages: 1,580 Likes Received: 0 The only thing I ever get from this site is good advice and a few laughs. How does that bother people?   #24 farmercal , Aug 6, 2004 preslove Lifer Joined: Sep 10, 2003 Messages: 16,679 Likes Received: 39 Originally posted by: farmercal The only thing I ever get from this site is good advice and a few laughs. How does that bother people? Click to expand... I don't know, but someones complaining about them   #25 preslove , Aug 6, 2004 (You must log in or sign up to post here.) Show Ignored Content Page 1 of 2 1 2 Next > Your name or email address: Do you already have an account? No, create an account now. Yes, my password is: Forgot your password? Stay logged in Sign up now! New Posts AMD Vega (FE and RX) Benchmarks [Updated July 26] Latest: Elixer, Jul 26, 2017 at 9:24 PM Video Cards and Graphics Vega/Navi Rumors (Updated) Latest: SickBeast, Jul 26, 2017 at 9:23 PM Video Cards and Graphics Is MSI fast-becoming the 2nd largest motherboard manufacturer? Latest: kwalkingcraze, Jul 26, 2017 at 9:23 PM Motherboards Game of Thrones - TV Series (NO BOOK SPOILERS) Latest: Homerboy, Jul 26, 2017 at 9:22 PM Off Topic President Trump Tweets Against Transgender People in the Military Latest: brycejones, Jul 26, 2017 at 9:22 PM Politics and News AnandTech Forums: Technology, Hardware, Software, and Deals Home Forums > Social > Off Topic > Toggle Width Style Anandtech default style Home Contact Us Help Terms of Use Privacy Policy Top Copyright © 2016 Purch Group, Inc. All Rights Reserved Theme designed by Audentio Design . AnandTech Forums: Technology, Hardware, Software, and Deals Home Forums > Social > Off Topic >

Home

Sample Copyright Complaint Steps

HostGator requires DMCA notices to be filed via fax or letter. The complaint must include full contact information in the complaint (including phone number). We will call and verify. Email (unless digitally signed by a verified and trusted third party) is not an acceptable medium for legal complaints. This ticket system has received what appears to be a possible DMCA complaint, but one or more of the following are missing: (a) the complaint does not contain sufficient information (b) the format of the complaint is inconsistent with the requirements of the DMCA (c) the complaint has been submitted via email without proper authentication (d) full contact information is missing. We will need you to re-submit your claim, using the proper format, including sufficient details, via postal mail or fax. Instructions on how to do so follow.

It is our policy to respond to clear notices of alleged copyright infringement. This response describes the information that should be present in these notices. It is designed to make submitting notices of alleged infringement to us as straightforward as possible while reducing the number of notices that we receive that are fraudulent or difficult to understand or verify. The form of notice specified below is consistent with the form suggested by the United States Digital Millennium Copyright Act (the text of which can be found at the U.S. Copyright Office Web Site, http://www.copyright.gov ) but we will respond to notices of this form from other jurisdictions as well.

To file a notice of infringement with us, you must provide a written communication that sets forth the items specified below. Please note that you will be liable for damages (including costs and attorneys' fees) if you materially misrepresent that a product or activity is infringing your copyrights. Accordingly, if you are not sure whether material available online infringes your copyright, we suggest that you first contact an attorney.

Identify in sufficient detail the copyrighted work that you believe has been infringed upon (for example, "The copyrighted work at issue is the text that appears on http://www.hostgator.com/tos ") or other information sufficient to specify the copyrighted work being infringed (for example, "The copyrighted work at issue is 'Intellectual Property: Valuation, Exploitation, and Infringement Damages' by Gordon V. Smith, published by Wiley, ISBN #047168323X").

Identify the material that you claim is infringing the copyrighted work listed in item #1 above. You must identify each web page that allegedly contains infringing material. This requires you to provide the URL for each allegedly infringing result, document, or item.

An example:
Infringing Web Pages: http://www.thewebsite.com/directory/ http://www.thewebsite.com/something/blah.html

Provide information reasonably sufficient to permit us to contact you.

Provide information, if possible, sufficient to permit us to notify the owner/administrator of the allegedly infringing webpage or other content (email address is preferred).

Include the following statement: I have a good faith belief that use of the copyrighted materials described above as allegedly infringing is not authorized by the copyright owner, its agent, or the law.

Include the following statement: I swear, under penalty of perjury, that the information in the notification is accurate and that I am the copyright owner or am authorized to act on behalf of the owner of an exclusive right that is allegedly infringed.

Sign the paper.

For the fastest processing and response we ask that DMCA complaints be submitted through our online form at

http://hostgator.com/dmca

Or faxed to us at

(281) 476-7801, Attn: Abuse Department, DMCA Complaint

While not recommended you may also mail your request to us at

HostGator LLC Attn: Abuse Department, DMCA Complaint 5005 Mitchelldale, Suite #100 Houston, TX 77092 United States of America

Please allow routing and scanning time for mailed DMCA complaints.

Regardless of whether we may be liable for such infringement under local country law or United States law, we may respond to these notices by removing or disabling access to material claimed to infringe and/or terminating users of our services. If we remove or disable access in response to such a notice, we will make a good-faith attempt to contact the owner or administrator of the affected site or content so that the owner or administrator may make a counter notification.

We may also document notices of alleged infringement on which we act. As with all legal notices, a copy of the notice may be made available to the public and sent to one or more third parties who may make it available to the public.

In order to ensure that copyright owners do not wrongly insist on the removal of materials that actually do not infringe their copyrights, the safe harbor provisions require service providers to notify the subscribers if their materials have been removed and to provide them with an opportunity to send a written notice to the service provider stating that the material has been wrongly removed. [512(g)]

If a subscriber provides a proper "counter-notice" claiming that the material does not infringe copyrights, the service provider must then promptly notify the claiming party of the individual's objection. [512(g)(2)] If the copyright owner does not bring a lawsuit in district court within 14 days, the service provider is then required to restore the material to its location on its network. [512(g)(2)(C)]

If it is determined that the copyright holder misrepresented its claim regarding the infringing material, the copyright holder then becomes liable to the OSP for any damages that resulted from the improper removal of the material. [512(f)]