Current location: Hot Scripts Forums » Programming Languages » PHP » PHP to calculate HTML forms


PHP to calculate HTML forms

Reply
  #1 (permalink)  
Old 10-25-04, 06:27 AM
jamesian jamesian is offline
New Member
 
Join Date: Oct 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy PHP to calculate HTML forms

Hi everyone,

I am really needing some advice, I am not too sure if Java would be suitable for this purpose but I can ask for free….

I have a shopping cart system; its front end is a HTML form. The form needs to calculate the transfer of umatic video tapes.

I have tried using HTML, and asked for some advice on using Java but from talking to people it seems PHP maybe the better option, here what I need to do, if anyone can help me or suggest any code I can use I would be extremely grateful!

Although please bare in mind my knowledge of PHP is extremely limited so I throw my self at your mercy.

The form has to:

Ask how many hours the client will be sending and charge per hour (I can do this using the shopping cart)

Ask which formats they are sending and how many tapes (again I do this using option from my cart)

Ask for additional copies, this is the problem mainly. The user must input how many hours they require, this is then charged per hour. This bits fine, however the form must offer additional copies, I can add additional copies via another text field input, the problem is a user can input as many hours of footage to transfer as they like, and my problem is a tape can only hold two hours.

The additional copies field has to take this into account.

For example they order an 8 hour transfer and want one set of additional copies, I charge $10 for example per additional copy, the trouble is I have to charge £10 per tape, hence 2s into 8 go 4 times I would have to charge $40, opposed to $10.

Any one got any ideas how I can do this using PHP? Will arrays work for this, and if so how? Then would it be possible to send the results to my shopping cart or out put them as a button that carriers the overla cost with it, am i barking up the wrong tree or what?

Many thanks for your time.
Reply With Quote
  #2 (permalink)  
Old 10-25-04, 07:45 AM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
you can read about php session and cookies. to solve your problem, it can use mathematical expression which is available in php. to check user input, you can use regex or simple if-else condition. good luck!!
__________________
just an ignorant noob with moronic solution...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP in HTML Pages? ZeoFateX PHP 19 01-04-06 06:42 PM
Can PHP place quotes around HTML attributes frdmsun PHP 1 08-17-04 02:12 AM
PHP results in HTML bayside PHP 6 06-27-04 10:31 PM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 11:19 AM
general question about php and html timfoster PHP 3 05-17-04 12:29 PM


All times are GMT -5. The time now is 04:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.