I run a small business in which I build very customized computers for home and business users (a lot of gamers, actually), and I want to add some functionality to my website by providing a way for users to have a list of available options, selectable by radio button and divided by category. I then want the price to be updated upon the click of a button.
The problem is, I have almost no idea how to go about doing this. I've moved all of my HTML from the original webpage into acceptable Perl format, but now I've got the issue of creating the CGI to do this. I thought something like the following would be good for where the price actually is stated:
if ($opcost = 0) {
print "Go to the Options section to calculate!";
} else {
print $price;
}
Basically, I want the following:
- A running tally of how much the options will change the original price, i.e., if I get a video card that costs $20 less than the standard, $optioncost -= 20.
- To factor that total tally into $baseprice, the original price.
- I'd prefer to have just one file to work with, rather than an HTML file and a CGI file. I've got the HTML Perlized, so that's not so much an issue.
I've worked some with HTML forms and Perl before, but I do not yet understand how to work with things like radio buttons (what values they return, whether to use POST or GET depending on situation), even though I've read that portion of the Llama. I understand that this should be a pretty simple thing to do, but I need help in assembling the parts and understanding.
Thanks in advance for the help!
Foncé
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.