will somebody show me a sample how to add cart using dynamic button??
im having trouble retrieving value using dynamic button
using the code below
#
echo("<TR id='$i' bgcolor='B0C4DE'>");
#
$sr_num=$row['b_sr_num'];
#
echo ("<td><input name=data id=data type=text id=data readonly=readonly value=$sr_num></td>");
#
echo ('<td>'.$row['b_name'].'</td>');
#
echo ('<td>'.$row['b_author'].'</td>');
#
echo ('<td>'.$row['b_avail'].'</td>');
#
#
if($row['b_avail']>0)
#
{
#
if (!$_SESSION["valid_user"])
#
{
#
// User not logged in, redirect to login page
#
echo("<td>Available</td>");
#
}else
#
echo("<td><INPUT TYPE=button id=show name=show value=add onClick= buttonPress('$sr_num')></td>");
#
#
}else
#
echo("<td>No stock of book</td>");
#
echo("</TR>");
#
$i=$i+1; }
#
echo("</TABLE>");
should i use php or ajax?