...

View Full Version : problem with get button



graham23s
11-13-2007, 10:58 PM
Hi Guys,

what im trying to do is when a user clicks a button the get at the bottom of the page grabs it and displays data, i can to it with text no problem but having trouble getting this button to grab it

partial code:


echo ("<tr>");
echo ("<td colspan=\"2\" align=\"right\"><form action=\"credits.php\" method=\"get\"><input type=\"hidden\" name=\"action\" value=\"show\" \><input type=\"submit\" class=\"btn\" name=\"show\" value=\"Show Credits\"></form></td>");
echo ("</tr>");
echo ("</table></form>");

if($_GET['action'] == 'show')
{

## display previous credits for editing etc
//$querycredits = ("SELECT * FROM `userscredits` WHERE `userid`='$var_loggedinuserid'");
//$resultcredits = mysql_query($querycredits);

echo "this is the get";

} // end get

can nayone see the problem at all?

thanks guys

Graham

GO ILLINI
11-15-2007, 06:10 AM
just change the if line to


if(isset($_GET['show'])) {


The submit button returns its value just like any other input field, so you can see if that button was pressed.

-Adam



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum