php calculate


Posted on 16th Feb 2014 07:03 pm by admin

this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNumberAdults=$_POST['TotalNumberAdults'];
$TotalNumberChildren=$_POST['TotalNumberChildren'];
Did you know?Explore Trending and Topic pages for more stories like this.
$TotalNumber=($TotalNumberAdults + $TotalNumberChildren);

?><?php echo sprintf($TotalNumber);?>
<input name="TotalNumber" type="hidden" value="<?php echo sprintf($TotalNumber);?>" size="7">
No comments posted yet

Your Answer:

Login to answer
254 Like 25 Dislike
Previous forums Next forums
Other forums

Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t

How to show next and prev records
Hi all,

Sorry if this is simple, i'm very new to php, well, any programming language actually

Placing and array within an array then sorting it!
I have a page that runs two large mysql queries and saves the results into arrays, in php I then per

How to have a log of all the status a VIM document had been ?
Hi guys,

I’m using SAP Invoice Management plugin and the /OPT/VIM_ANALYTICS transa

how to remove in php string display
My code is $message="We're looking at developing our website."; $body= "My mess

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

Typing math
I've added support for typesetting math using LaTeX on the forums.

Example:
Code: [Select]

FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image

Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto

problem with GROUP BY and ORDER BY
i usually use this query to display the last 10 entries from a sql table:

Code: $query = &quo

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash