Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-13-2007, 09:58 PM   PM User | #1
graham23s
Regular Coder

 
Join Date: Jul 2007
Location: Scotland
Posts: 134
Thanks: 12
Thanked 0 Times in 0 Posts
graham23s is an unknown quantity at this point
problem with get button

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:

PHP 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
graham23s is offline   Reply With Quote
Old 11-15-2007, 05:10 AM   PM User | #2
GO ILLINI
Regular Coder

 
GO ILLINI's Avatar
 
Join Date: Jun 2005
Location: USA
Posts: 634
Thanks: 0
Thanked 7 Times in 7 Posts
GO ILLINI is an unknown quantity at this point
just change the if line to
PHP Code:
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
__________________
Why not thank me?

http://adamsworld.name
GO ILLINI is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:13 AM.


Advertisement
Log in to turn off these ads.