Connecting Tech Pros Worldwide Help | Site Map

looking for examples

  #1  
Old July 17th, 2005, 05:19 AM
toylet
Guest
 
Posts: n/a
Any website that has discussion about programming a one-to-many input
form (like an invoice) using php and mysql? I want to see how
professional codes it, and handle issues related to the refresh and back
buttons.

--
.~. Might, Courage, Vision. In Linux We Trust.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.22-xfs
^ ^ 4:42pm up 2 days 20:21 load average: 0.99 0.97 0.94
  #2  
Old July 17th, 2005, 05:20 AM
Henk Verhoeven
Guest
 
Posts: n/a

re: looking for examples


toylet wrote:[color=blue]
> Any website that has discussion about programming a one-to-many input
> form (like an invoice) using php and mysql? I want to see how
> professional codes it, and handle issues related to the refresh and back
> buttons.
>[/color]
That would depend on the requirements. For example in a shopping cart
the user does only need to change the amount of each item, and delete
it. That can be done in a single page. For an employee making an invoice
there would probably be several input field for one item, so i would
make a page with a form for that and another page for the invoice as a
whole and a table for the items, linking to the Item page.

Becuase of the refresh button i usually do a redirect after a POST.
That is somewhat slower, but it will make te refresh button harmless.

The back button can be more troublesome. For example it should not be
possible in an on line shop to plae an order, press back and incidently
place a second order when ignoring the browser's warning about the
repost. Easy enough to prevent: have an order number and declare the
order final when the customer presses the final OK. Then refuse whatever
transactions on final order. OTOH, i would not go that far for an hours
registation system where the employee can see an overview of what he
enters and can correct eventual 'per abuse' inserts.

maybe the hardest part of form processing is handling input errors.
That's becuase i think you shoud not thow away the errorneous data, but
rather re-present the form and ask the user to change it. Of course i do
not want to build the form generation code twice, so i need a way to
make it work on both data from the database and data from the previous
user form. I use objects for that, but i tend to use object for
everything, i guess others might use an Array.

I am afraid my code is not very representative, becuase it's very OOP
and completely generic (= pritty complex), but you can try out the
working example:
http://www.phppeanuts.org/examples/example2/

discussion about a replacement for the back button:
http://www.phppeanuts.org/site/index...xt+button.html

Greetings,

Henk Verhoeven,
www.phppeanuts.org.



Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python Web Programming - looking for examples of solid high-traffic sites Victor Kryukov answers 34 May 25th, 2007 02:45 AM
Looking for examples stan answers 1 September 11th, 2006 02:45 PM
Looking for examples related to advanced python string, list and map operations A.M answers 2 June 16th, 2006 06:45 AM
Looking for examples of developing new Tkinter Widgets in Tcl/Tk jhujsak@neotopica.com answers 1 December 19th, 2005 08:15 AM