Connecting Tech Pros Worldwide Help | Site Map

looking for examples

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 04:19 AM
toylet
Guest
 
Posts: n/a
Default looking for examples

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, 04:20 AM
Henk Verhoeven
Guest
 
Posts: n/a
Default 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.



 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.