Showing posts with label Exercise 09. Show all posts
Showing posts with label Exercise 09. Show all posts

Tuesday, June 2, 2009

Exercise 9: Second Attempt

Well it is sometimes hard to see the wood from the trees.

It also helped when I read (Ince, p129-150) where he discusses Browsers and HTML. To date I have had little to no exposure to developing web pages. Thanks to this blog I am finally getting the hang of HTML.

So back to exercise 9. As it turns out my initial thoughts in Exercise 9: First attempt were correct. This is basically a rehash of what we did in exercises 6-8.

I was getting lost in the HTML on the entry form. Thanks to (Ince) I twigged to the fact that I needed to use the SUBMIT method on the form and the GET method in the php file to retrieve the information.

So here is the input form and the HTML to create it:

and the php file that parses the submitted data and outputs it.

As you can see from the output, to answer part 3 of exercise 9 yes I can modify the script to process the form.

Having just written that, the question poses another question. What does Ken mean in step 2 when he says list the steps involved in processing the form?

What steps did he have in mind? I can see that

  1. use the get method for each parsed parameter to retrieve the value.
  2. use the value to do something

Maybe his point is that it is a relatively trivial exercise to extract the information.

References Ince, D. (2006). Developing Distributed & E-commerce Applications: Prentice-Hall, Inc. Upper Saddle River, NJ, USA.

Monday, June 1, 2009

Exercise 9: First attempt

On first look, this looked the same as what we did in exercises 6,7 and 8

Consequently I just revised my efforts from Exercise 6 and got some output on the form. Alas, the url passed to the form does not contain the required parameter string. So now I need to look at some Javascript to work out how to do this. To google we go...

Unfortunately the site that I have gone to http://javascript.internet.com/forms/ list 1420 entries for the search term "process html forms data". Narrowing this down could take a while. However on the upside there seems to be some code that deals with creation of lookups and validation. All of which are relevant to parsing form data.

Sunday, May 17, 2009

Exercise 9: Web form design and processing: A basis for e-commerce interaction

  1. Design the form
    “Retrofit” the form data string above for buying some French perfume into the HTML form fields and submit button on the Web page form.
  2. Write the script
    Script archives exist for PERL, Python and JavaScript. Search the Web for a script that processes the HTML forms data. Read the code and list the steps involved in processing the form.
  3. Can you modify the script to process the form?