It looks like you're using an Ad Blocker.

Please white-list or disable in your ad-blocking tool.

Thank you.


Some features of ATS will be disabled while you continue to use an ad-blocker.


Help ATS via PayPal:
learn more

Website help?

page: 1

log in


posted on Nov, 18 2004 @ 10:16 PM
Can anyone direct me to a site that explains how to do this:

I am thinking of making a mathematical simulation using forms.
The idea is, the user puts variables into the forms and clicks 'submit', then the answer is produced. If someone could just explain how to do this with simple arithmetical problems and maybe provide other functions that could be used within a web page, that would be great??

posted on Feb, 6 2005 @ 07:52 PM
are you using php? if so, its fairly simple:

for example, you want to make a page that adds two numbers.

page one:

< form action= "page2.php" >
First number< input type="text" name="Add1" > < br >
Second number < input type="text" name="Add2" > < br >
< input type="submit" value="add_numbers">
< /form >

page two
< ? php
$variable1= $_POST["Add1"];
$variable2= $_POST["Add2"];

$answer = $variable1 + $variable2;

echo $answer;

? >

I hope that made sense. U2U me if you have other questions.


[edit on 6-2-2005 by pineappleupsidedown]

posted on Feb, 6 2005 @ 07:58 PM
You could also use JavaScript to do this client side. It's been a couple of years since I moved from doing websites to making software which interfaces with medical equipment, but back in the day was a fantastic source for all your web needs. For just JavaScript, this site is awesome:

You may even be able to find a free code sample doing almost exactly what you're trying to do there.

posted on Feb, 6 2005 @ 08:16 PM
Thanks to both of you. I knew it could probably be done with Javascript, although I still gotta learn how to write the code. The PHP example I will have to look into as I know ziltch about PHP. I don't even know if it is client/server side. I know that JS can be client side, which is what I want to do. Nevertheless, I appreciate the help!

posted on Feb, 6 2005 @ 08:29 PM
This is actually about arithmatic functions using JS:

For some reason the link I posted above doesn't work. To find the sight, hit google and use "JavaScript Source" as your keywords. It'll be the top sight. I was there constantly when I was working a lot with JS. The regular expression help is phenominal, though if you don't really know the language you may want to do it the long way as described in the link I put in this post.

posted on Feb, 6 2005 @ 10:41 PM
one slight correction on my part(thanks dreamlandmafia): on the first page, change the first line to say < form action= "page2.php" method="POST" >

i know you arent using it, but just for future reference.


new topics

top topics

log in