Conditional Radio buttons

Hi, i have a condition display depending on specific values. The show/hide bit if fine, just when i have $total > 250, i still get “standard” set to session and added to the DB (flicking between standard and express is fine)

[code]<?php if($total >'250'){ $selector='Gratis'; ?>

  • Free Text Box
  • <?php } else {?>
  • Standard Delivery (2-10 days)
    <div class="check"></div>
  • Express Delivery (1-3 days)
    <div class="check"></div>
  • <?php }; ?>[/code]

    …and on submit

    <? if (isset($_POST['checkxxx'])) { $div = $_POST['selector']; $_SESSION['divprice'] = $div; header('Location: ..); }

    I can’t see anything obvious but what i’d do is change


    $_SESSION['divprice'] = $_POST['selector'];

    as that gets rid of one line that isn’t needed as you are just converting one variable to another to another.

    Then instead of header('location… sending them off somewhere comment that out for now and instead echo the variable $_SESSION[‘divprice’] to the screen to see what it is actually storing. You can then try things like instead of the 2 radio fields put in a normal text field and test to see where that is giving you the output you expect. You can then narrow down where the error is occurring

    hum, ive echoed the sessions and the two radios are fine…with the >250 part its empty :frowning:
    Ive done a straight echo after the php script/radio buttons, just ‘<?php echo $selector ?>’, and its blank…so for some reason its not creating the value…

    should this not be an input of some kind eg hidden field? which you then pass as $_POST[‘selector’] to your second part?

    oh what a tw@t…i misspelt the ‘selector’ field :slight_smile:

    hahahah been there done that :slight_smile:

    This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.