Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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!


In reply to Price updating script ideas by FoncÚ

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2023-06-06 16:34 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (29 votes). Check out past polls.