Gif Input tag not working with code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
edawson003
Forum Contributor
Posts: 133
Joined: Thu Aug 20, 2009 6:34 am
Location: Los Angeles, CA - USA

Gif Input tag not working with code

Post by edawson003 »

I had a mysql query and while loop that I triggered with an submit input tag. I wanted to replace the generic button witg gif button created, but now the return won't work with the new button. Is there something I am missing?

old input button:
<input type=submit name=search2 value=Search>

new gif button:
<input type=image name=search2 value=Search src=../images/submit_b.gif width=70 height=17 ALT=Submit>

Code: Select all

<?php   
    if(isset($_POST['search2'])){    
    if(isset($_GET['searchcriteria']) && isset($_GET['go'])){      
    $searchparameter2 = mysql_real_escape_string($_POST['searchparameter2']);   
    $extype = $_POST['extype'];
    $movementtype = $_POST['movementtype']; etc etc etc
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Gif Input tag not working with code

Post by onion2k »

When you use an image input element you don't get $_POST['search2'] set. You get $_POST['search2_x'] and $_POST['search2_y']. Just check to see if one of those is set.
User avatar
edawson003
Forum Contributor
Posts: 133
Joined: Thu Aug 20, 2009 6:34 am
Location: Los Angeles, CA - USA

Re: Gif Input tag not working with code

Post by edawson003 »

I tried $_POST['search2_x'] and it worked. Thanks a lot!
Post Reply