Re: undefined variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



isset always returns 0

i create  dynamic textbox called quantity0, textbox1, textbox3.......

then i a, trying to get the content of the textbox but it is always 0.

as you can see, i tried the suggestions but it still dont work.

is there something iam doing wroing? why is the textbox always 0?


<table width="700">
<?  $query1 = mysql_query("SELECT * FROM products where product_group='$cat' 
order by position");
 $counter = 0;
 while ($rowType = mysql_fetch_array($query1))
 {
  $textbox="quantity";
  $textbox= "$textbox$counter";  //variable is set to quantity0, quantity1, 
quantity2 etc
?>
  <td width="30%">New row number: <? echo $counter; ?></td>
  <td width="30%">name of textbox: <? echo $textbox; ?></td>
  <? //below the textbox will be created?>
  <td width="10%"><input id="<? $textbox ?>" name="<? $textbox ?>" 
type="text" value="1" size="1" maxlength="3"></td>
<?
  //get content  of textbox
  $q = isset($_REQUEST['$textbox']) ? $_REQUEST['$textbox'] : 0;
?>
  <td width="10%"> <a href=" <? echo "products.php?quantity=$q"; ?>" 
</a>TEST</td>
  <td width="20%"> <? echo "content of textbox: $q"; ?> </td>
  </tr>
<?
  $counter++;
 }
?>
 </table>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux