calculating question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
upalm
Forum Newbie
Posts: 1
Joined: Fri Feb 27, 2009 9:53 am

calculating question

Post by upalm »

just starting out with php...here's my situation:
1)i have 4 text fields in a form and they are in an array

2)array_sum adds the values of the fields and is supposed to display the total as a variable using echo. it does this but the total is always 0. makes sense if all the fileds are null but when i change them, the total is not being refreshed in realtime.

3)i need the total variable to update every time one of the values in the 4 fields changes in realtime, so i get a running total displayed on the page. i don't want to do this clientside with javascript.

can anyone help?
thanks
upalm
Randwulf
Forum Commoner
Posts: 63
Joined: Wed Jan 07, 2009 7:07 am

Re: calculating question

Post by Randwulf »

This can't be done with PHP alone, if you want PHP to do the calculation you're going to need to use AJAX, which requires Javascript to be used.
Post Reply