+ Reply to Thread
Results 1 to 2 of 2

Thread: PHP form problem

  1. #1
    Join Date
    Nov 2006
    Posts
    109

    Default PHP form problem

    The form is a dynamic checkbox list pulled from the db.

    Even if checkbox(s) is checked or not I cannot retrieve the value of the selected item(s) after submitting the form with PHPself.

    Here is the input code of the form -
    <input type='checkbox' value='<?echo $ID;?>' name='<?echo $name_counter;?>'></b></td></tr>";

    If I place a php echo after the input field the variable $name_counter returns a name like name1, name2, name3 etc.

    Based on the above, once the form is submitted with the first three check boxes checked shouldn't something like this code retrieve the values after submitted with phpself?

    echo $name1;
    echo $name2;
    echo $name3;

    That won't return anything though.

    I tried get and posts
    as in
    $t1=$_get['name1'];
    echo 't1 = ', $t1;?><BR><?
    $t2=$_GET['name2'];
    echo 't2 = ', $t2;?><BR><?
    or
    $t1=$_POST['name1'];
    echo 't1 = ', $t1;?><BR><?
    $t2=$_POST['name2'];
    echo 't2 = ', $t2;?><BR><?

    I've been reading Google posts about it all night without success.

  2. #2
    Join Date
    Nov 2006
    Posts
    109

    Default Re: PHP form problem

    Sorry but I guess I'm Getting through it. I removed the <?echo ' and left just the variale there and it is picking up the value.

+ Reply to 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