www.webdeveloper.com
Results 1 to 2 of 2

Thread: Saving value of radion buttons in different variables

  1. #1
    Join Date
    Jun 2011
    Posts
    20

    Post Saving value of radion buttons in different variables

    if I submit the HTML Form in action.html file.
    this html Form has some Radio Buttons.
    the value of selected radio button is received in action.php file.
    I want to save this value in a variable.
    if I submit the Form again with different radio button selection, then it should be saved in another variable.
    in this way, if I have there radion buttons , then I should have three different variables.
    How can I get it.How can save its value in one variable for complete sesseion.thanks.

  2. #2
    Join Date
    Nov 2006
    Location
    Oakland
    Posts
    500
    I would suggest a hidden field with a count of the number of submissions.
    For instance the first time the form is show you would have:
    <input type="hidden" name="counter" value="1">
    Your session value for the first submission would be for instance:
    $k=$_POST['counter'];
    $_SESSION['var'.$k]=$_POST['radiofield'];

    Where radiofield would be the name of your radio buttons.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles