Professional Web Applications Themes

how to catch a value from radio buttom getting its value from mysql? - PHP Development

Hi, this is a newbie question. How can I catch the selected radio value from a form that is feed by the mysql database? EX.: <input type="radio" name="myname" value="<?php $myvalue[3] ?>"> Value returns the last element of the array $myvalue[3] instead of the selected value. How can I change this? Thanks in advance for any help, Guillermina...

  1. #1

    Default how to catch a value from radio buttom getting its value from mysql?

    Hi, this is a newbie question.

    How can I catch the selected radio value from a form that is feed by the
    mysql database?

    EX.:
    <input type="radio" name="myname" value="<?php $myvalue[3] ?>">

    Value returns the last element of the array $myvalue[3]
    instead of the selected value.

    How can I change this?

    Thanks in advance for any help,


    Guillermina

    gmanon Guest

  2. #2

    Default Re: how to catch a value from radio buttom getting its value from mysql?

    echo?

    <input type="radio" name="myname" value="<?php echo $myvalue[3] ?>">

    PWT

    "gmanon" <guillerminanyc.rr.com> wrote in message
    news:3FAC73F3.4000602nyc.rr.com...
    > Hi, this is a newbie question.
    >
    > How can I catch the selected radio value from a form that is feed by the
    > mysql database?
    >
    > EX.:
    > <input type="radio" name="myname" value="<?php $myvalue[3] ?>">
    >
    > Value returns the last element of the array $myvalue[3]
    > instead of the selected value.
    >
    > How can I change this?
    >
    > Thanks in advance for any help,
    >
    >
    > Guillermina
    >

    Peter Taurins Guest

  3. #3

    Default Re: how to catch a value from radio buttom getting its value frommysql?

    Yes, I'm using echo. May that be the problem? Should I use print or
    printf instead?

    Guillermina




    Peter Taurins wrote:
    > echo?
    >
    > <input type="radio" name="myname" value="<?php echo $myvalue[3] ?>">
    >
    > PWT
    >
    > "gmanon" <guillerminanyc.rr.com> wrote in message
    > news:3FAC73F3.4000602nyc.rr.com...
    >
    >>Hi, this is a newbie question.
    >>
    >>How can I catch the selected radio value from a form that is feed by the
    >>mysql database?
    >>
    >>EX.:
    >> <input type="radio" name="myname" value="<?php $myvalue[3] ?>">
    >>
    >> Value returns the last element of the array $myvalue[3]
    >> instead of the selected value.
    >>
    >> How can I change this?
    >>
    >>Thanks in advance for any help,
    >>
    >>
    >>Guillermina
    >>
    >
    >
    >
    gmanon Guest

  4. #4

    Default Re: how to catch a value from radio buttom getting its value from mysql?

    With total disregard for any kind of safety measures gmanon
    <guillerminanyc.rr.com> leapt forth and uttered:
    > Yes, I'm using echo. May that be the problem? Should I use
    > print or printf instead?
    He was pointing out that your first example doesn't output the
    variable at all as you don't use echo or anything else.

    --
    There is no signature.....
    Phil Roberts Guest

  5. #5

    Default Re: how to catch a value from radio buttom getting its value frommysql?

    Hi, Here a more detail script.

    //VARIABLES FROM DATABASE RESULT
    $row_array['city'] = $row_items[1];
    $row_array['price'] = $row_items[3];
    $row_array['description'] = $row_items[4];
    $row_array['id'] = $row_items[5];

    $id = $row_array[5];
    $description = $row_array[4];
    $price = $row_array[3];

    //HTML CODE FOR RADIO BUTTON
    if ($j == 1) { $radio = "<input type='radio' name='city' value='" .
    $row_array[2] . "'>";}
    else { $radio = "";}

    //HIDDEN VALUES

    <input type="hidden" name="tripNumber" value="<?php echo $id; ?>">
    <input type="hidden" name="tripDescription" value="<?php echo
    $description; ?>">
    <input type="hidden" name="tripPrice" value="<?php echo $price; ?>">

    //VARIABLES FOR OUTPUT

    <td align="center" class="tableInside"><?php echo $tripNumber; ?></td>
    <td align="center" class="tableInside"><?php echo $tripDescription; ?></td>
    <td align="center" class="tableInside"><?php echo $noPassangers; </td>
    <td align="center" class="tableInside"><?php printf("$%.2f",
    $tripPrice); ?></td>
    <td class="tableInside" align="right"><?php $subtotal = $tripPrice *
    $noPassangers; printf("$%.2f", $subtotal); ?>&nbsp;&nbsp;</td>

    Guillermina

    >>Yes, I'm using echo. May that be the problem? Should I use
    >>print or printf instead?
    >
    >
    > He was pointing out that your first example doesn't output the
    > variable at all as you don't use echo or anything else.
    >


    gmanon Guest

Similar Threads

  1. Radio Button Variables to MySQL
    By Deutscher in forum PHP Development
    Replies: 4
    Last Post: October 10th, 07:34 AM
  2. Using an image as my submit buttom
    By rudodoo619 in forum Macromedia Dynamic HTML
    Replies: 7
    Last Post: March 10th, 02:07 PM
  3. Catch 22 with file removal or mysql queries?
    By Bonge Boo! in forum PHP Development
    Replies: 2
    Last Post: July 11th, 04:59 AM
  4. Replies: 2
    Last Post: June 23rd, 04:45 AM
  5. buttom with protected files
    By tyco_simel@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 10
    Last Post: April 21st, 07:58 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139