473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Compute and display data on the same page

well,
when user inputs the data, i should be able to fetch the data from the database and do some numerical computaions and display the result on the same page before i submit the data to the php script,

the php script takes all the posted data and dump it into the database,


how to achieve this

me using
PHP 5.0/MySQL 4.0
Jan 27 '07 #1
5 1757
acoder
16,027 Expert Mod 8TB
What code do you have so far?

This should be posted in the PHP forum, but don't double post. A moderator will probably move it soon.
Jan 27 '07 #2
Ganon11
3,652 Expert 2GB
Indeed, we will. Moving this thread...
Jan 27 '07 #3
Niheel
2,460 Expert Mod 2GB
Look into the use of Javascript to process data on the client side, or if you really want to get creative, AJAX.
Jan 27 '07 #4
ronverdonk
4,258 Expert 4TB
Looks indeed like the perfect problem to tackle with an Ajax solution. That way you can, after the user has inputted some field(s), go to the server database, get the data and display it on the screen. All without screen refreshes.

But, as acoder put to you in an earlier post: "What code do you have so far?". Show it and we will see where we can assist you.

Ronald :cool:
Jan 28 '07 #5
mainul
51
Hi
you can use the following code for a running total. customize it according to ur requirements.

[HTML]
<html>
<head>
<script>
function getTotalBurn()
{
f = document.form1;
superficial = parseFloat(f.a.value) + parseFloat(f.b.value)
f.c.value = superficial.toFixed(2)
}
</script>
</head>
<body>

<form id="form1" name="form1" method="post" action="" onkeyup="getTotalBurn()">
<p>
1st Number
<input type="text" name="a" size="10" />
</p>
<p>
2nd Number
<input type="text" name="b" size="10" />
</p>
<p>
Total
<input type="text" name="c" value="0" size="10" />
</p>
</form>
</body>
</html>
[/HTML]
Jan 29 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: wildbill | last post by:
I'm looking for an example of how to compute an age of a record in a query and then display that on a form. For example: I have record that shows it was entered on 8/2/2005. I would like to be...
1
by: skirkby | last post by:
This will be obvious to some - but not me I'm afraid... I am using an SQL data link from my ASP application to a SPROC - this all works fine on standard SELECT statements and JOIN in to a...
0
by: Glen | last post by:
Is there any way to post data to an ASP.Net form and then display the page to the user with the posted data from a client app? Here's what I'm trying to do: Serialize a business object (order)...
18
by: Terry Holland | last post by:
I have an asp.net (1.1) application that connects to a SQL server 2000 db. I have a stored procedure in my db that out puts data in xml format. What I need to be able to do is display that xml...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.