Forum Moderators: coopster
The problem is it is posting multiple variables :
while ($row = mysql_fetch_assoc($r)) {
$activityid=$row["activityid"];
$activityname=$row["activityname"];
echo "<tr bgcolor=",$bgcolor," ><td width='310' align='center' > Interested </td><td> <form action='book.php' method='get'>";
echo "<input type ='hidden' name='activity' value=",$activityid," />
<input type='submit' name='submit' value='Book Now' /> </td></tr>
"; }
The if you examine my header it looks like this :
book.php?activity=1&submit=Book+Now&activity=2&activity=3&activity=4&activity=5
which means it is posting all the activities if i am not mistaken ?
it currently is:
<input type ='hidden' name='activity'
change to :
<input type ='hidden' name='activity[]'
I'd also recommed changing the action to POST - GET is probably not the best option for forms (unless you have a good reason to us it)
However, if you actually do want to have multiple different forms, then just give each form a unique form name tag value.