This topic is in the Website Design discussion forum.  (rss)


Website help?




Topic started on 18-11-2004 @ 10:16 PM by ben91069


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??



reply to this post:   copyright & usage 


reply posted on 6-2-2005 @ 07:52 PM by pineappleupsidedown


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.

---Pineapple


[edit on 6-2-2005 by pineappleupsidedown]



reply to this post:   copyright & usage 


reply posted on 6-2-2005 @ 07:58 PM by junglejake


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 developer.netscape.com was a fantastic source for all your web needs. For just JavaScript, this site is awesome: http://_javascript.internet.com/

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



reply to this post:   copyright & usage 


reply posted on 6-2-2005 @ 08:16 PM by ben91069


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!



reply to this post:   copyright & usage 


reply posted on 6-2-2005 @ 08:29 PM by junglejake


This is actually about arithmatic functions using JS:

www.webdeveloper.com...

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.



reply to this post:   copyright & usage 


reply posted on 6-2-2005 @ 10:41 PM by pineappleupsidedown


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.

---Pineapple



reply to this post:   copyright & usage 










Top Topics Right Now:



Active Topics Right Now:



ATS MIX Podcasts:











Newest Topics:


























ATS Server: www4.theabovenetwork.com
Powered by AboveTop:Board v2.3
Header data processed in 0.006 seconds
Page processed in 0.079 seconds
6 total database queries (1)









The Above Top Secret Conspiracy Community Web site is a wholly owned social content community of The Above Network, LLC.





thread