On Thu, 30 Jan 2003, Chris Hayes wrote: > At 12:18 30-1-2003, you wrote: > >sure this would work but it'd be VERY inefficient in my application. It's a > >file browser application so i have hundreds of folder icons on a page .. the > >'submit' element will pass back the name of the button clicked and it would > >be available immediately/directly, which is what i want. BUT an 'image' > >element would require me to loop through ALL buttons doing an 'isset' test > >on each one. > * if there is not other data in the form you coudl turn it into an image > link and get the value in the $_GET > * else walk through the $_GET vars (each key/value) untill you see a > varname that could be what you looked for.
Or why not: $lookingfor = 'somebutton'; if (isset($_REQUEST[{$lookingfor . '_x'}])) { print "Found it, a button named $lookingfor was clicked"; } Or something, I think this is what you mean? Whatever the problem, there will be a solution ... don't stress :) But regarding the problem here, I don't get what you mean. How familiar are you with arrays? Anyway, as Chris stated, the name/value will be available in the appropriate autoglobal which will be $_POST or $_GET, and/or $_REQUEST. > >I can't believe html provides no means for using an icon as a submit button. > well it does doesn't it? > > >by the way .. unrelated question ... why would one want to use > >$_REQUEST['foo'] instead of just $foo? doesn't php give you access to form > >variables using the latter construct which is much cleaner? > not automatically anymore since PHP 4.10. > and the exact reason was that the old way was NOT clean, see the release > notes for PHP 4.10 for the details. It's as of PHP 4.2.0 that the default value of the register_globals directive went from on to off. It is this directive that pollutes your script with these variables and it's recommended to not use them and leave this deprecated directive off. Now what happened in PHP 4.1.0 was the introduction of autoglobals but this is all described in various places in the manual and here's such a place that links to others: http://www.php.net/variables.external May as well read this too: http://www.php.net/release_4_2_0.php Where have you been, hibernating? :) Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php