943,682 Members | Top Members by Rank

Ad:
Jun 20th, 2009
0

BMI calculator?

Expand Post »
Hey,

I wanted to create a Body Mass Index calculator. I've already created a seperate HTML file with a form where you have to type in your weight and height. So far so good, now I want to 'transfer' the data to my cgi script (unix shell script) as soon as I hit the 'Submit' button. But I have no idea how to start the cgi script. So it like copies the data from the form into the script where I can calculate the body mass index in the end.

I tried a lot of things already but nothing worked so far. So I was wondering if anyone could give me a tip or something? I already checked the entire world wide web (or so it seemed xD) but I didn't really find anything.

Sorry if this is not allowed here, but I didn't know where else to ask.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kaleidoscope is offline Offline
2 posts
since Jun 2009
Jun 20th, 2009
0

Re: BMI calculator?

Try these links to start.
http://www.tizag.com/htmlT/forms.php
http://hoohoo.ncsa.illinois.edu/cgi/primer.html

You start your application by placing it's path in the action attribute of the form tag.
Reputation Points: 10
Solved Threads: 4
Newbie Poster
rcollins is offline Offline
17 posts
since May 2009
Jun 20th, 2009
0

Re: BMI calculator?

Thank you for the links.
So I have my HTML file now with the form (+ form tag where I placed the url to the cgi script). I read through the 2nd link and it says that the most important command is the "Query_String" command.

So, how do I start my cgi script now? I know that I have to say "#!/bin/bash .... content-type: text/html" and so on but I don't really know where to place the Query_String or what to do with it?! Do I start with "read QUERY_STRING" and then "echo QUERY_STRING" for example?

Sorry for being such a noob. I know what I wanna do but I don't know how to do it exactly :/

Thanks for your help though!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kaleidoscope is offline Offline
2 posts
since Jun 2009
Jun 20th, 2009
0

Re: BMI calculator?

hiyya,

Before doing all this stuff.

First step is to do is

a) Configure apache Server (Find in google how to do)
b) Run few sample example which is bultin in apache server
just to confirm whether apache is properly configured
c) Use FORM tag in html to run CGI script. There are quite good number of examples available on net ( Let me know if u are not able
to get this)
Reputation Points: 10
Solved Threads: 6
Light Poster
msvinaykumar is offline Offline
48 posts
since May 2006
Jun 20th, 2009
0

Re: BMI calculator?

And also to start ur CGI script
just press SUBMIT button in html from
Reputation Points: 10
Solved Threads: 6
Light Poster
msvinaykumar is offline Offline
48 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: Simple script
Next Thread in Shell Scripting Forum Timeline: Script to Change file permissions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC