Current location: Hot Scripts Forums » Programming Languages » PHP » image submit button problems


image submit button problems

Reply
  #11 (permalink)  
Old 12-22-03, 08:15 PM
caustic caustic is offline
New Member
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Follow up

Never posted here, but I was looking for a solution to pass values with an image submit button for the EXACT same reason. What I came up with is a little different and is probably what you were looking for. And so, though this post is really old.. I'm posting so anyone in the future will have a solution. It seems that if you use brackets as the name, it'll set it as a key in the array, which is quite useful for doing something such as:


HTML/PHP Shortcode:

<input type="image" name="remove[<?=$product_key?>]" src="/remove_item.gif" value="<?=$product_key?>">

Where the key could be any sort of Product/Item ID, whatever..

PHP:

if($remove) {

// use key as the name
$remove_item = key($remove);

//remove item from session
unset($_SESSION["cart"][$remove_item]);
}

Hope this is helpful to someone out there!

Jeremy
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic image src = Newbie question clintre PHP 1 10-07-03 09:56 AM
radio button selection TheLaughingBandit ASP 3 08-31-03 06:22 PM
camera phone image poster apt2 Script Requests 2 08-29-03 07:20 PM
A different kind of image counter Stix Script Requests 1 08-11-03 11:50 PM
Skript to convert email to image spade PHP 1 06-11-03 09:28 AM


All times are GMT -5. The time now is 07:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.