Advanced Search

Results 1 to 6 of 6

Thread: Need some help.

  1. #1
    Join Date
    Jan 2007
    Location
    Close to the fridge
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need some help.

    In a nutshell I am brand spanking new to this language. I have designed a few websites and I am fairly good at it. I have always managed to find a way around using PHP, java, and stuff like that. I have a site that uses PHP but I had nothing to do with the code and had a heck of a time installing it. Anywasys bottom line is I am wet, errr soaked behind the ears when it come to PHP and other scripts and I want to learn now. I am actually reading PHP for Dummies, and will continue on from there. Anyhow the next site I am building requires a script that works similar to this site, the function I am interested in is the use of the radial buttons and the way it tallies the price.

    http://www.pugetsystems.com/configgaming.php?sys_id=15

    I found Dynamic Drive in the source code.

    Anyways if anyone can tell me what this code is, and/or, if I need to finish reading another 27 PHP books before actually being capable of using it, I would appreciate it.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    A group of radio buttons with the same name are available in your PHP script as an array. If you don't understand how to access form data yet, or what an array is, then aye, you've got a way to go before doing that.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2007
    Location
    Close to the fridge
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    LOL gotcha...back to the books...

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    the function I am interested in is the use of the radial buttons and the way it tallies the price
    Well for starters, with PHP forms like this you always have to do the HTML end of things first:

    anypage.htm
    Code:
    <form action="submit.php" method="post">
    Value 1:
    <input type="checkbox" name="checkbox1" value="15">
    <br>Value 2:
    <input type="checkbox" name="checkbox2" value="45">
    <br><input type="submit">
    </form>
    submit.php - processes the information
    PHP Code:
    <?php
    $field1 
    $_POST["checkbox1"];
    $field2 $_POST["checkbox2"];
    $output $field1 $field2;
    echo 
    $output;
    ?>
    Let's break down the above script:
    first line: "$" always starts before defining a variable, which in this case it's contents is checkbox1's value.
    Line two is the same except your defining the second checkbox.
    Line four processes the information, adding $field1 and $field2.
    Line five is a simple statement "echo" which writes the variable $output.
    The outcome should be "60"

    That should point you in some direction.
    - Mike

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Oops, sorry Twey. We cross-posted.
    - Mike

  6. #6
    Join Date
    Jan 2007
    Location
    Close to the fridge
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks but I now know I need to do some reading before I ask to many more questions because I am just wasting your time if I don't understand your answer. At least this is here for when I do understand.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •