RE: [PHP] Submit Image Button

From: Date: Thu, 03 Apr 2003 02:41:02 +0000
Subject: RE: [PHP] Submit Image Button
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-142059@lists.php.net to get a copy of this message
Well you can ignore it if you don't need the X/Y cord... But you can use it to make sure the button was clicked: If(!$_GET['sub_x'] || !_GET['sub_y']) { // display form } else { // it was submitted -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >-----Original Message----- >From: Thomas [mailto:zaxisnet@hotmail.com] >Sent: Wednesday, April 02, 2003 9:39 PM >To: php-general@lists.php.net >Subject: Re: [PHP] Submit Image Button > > >ok, sorry I'm a newb...what do I do with that info? I saw >that page, but it makes no sense to me > >Thomas > > >"John Coggeshall" <john@coggeshall.org> wrote in message >news:000301c2f989$dd4d1f50$1f01a8c0@cooglewin... >> >> >> http://www.php.net/manual/en/language.variables.external.php >> >> <input type="image" src="image.gif" name="sub"> >> >> This creates variables $_GET['sub_x'] and $_GET['sub_y'] containing >> the X/Y cordinate where the button was clicked (assuming it was GET >> method form submission) >> >> John >> >> >-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >> John Coggeshall >> john at coggeshall dot org >http://www.coggeshall.org/ >> >-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >> >> >> >-----Original Message----- >> >From: Thomas [mailto:zaxisnet@hotmail.com] >> >Sent: Wednesday, April 02, 2003 9:27 PM >> >To: php-general@lists.php.net >> >Subject: [PHP] Submit Image Button >> > >> > >> >I have a problem with my php. >> > >> >I have a form and in that form there is an image submit >button. When >> >I click on it, it won't tell me if the submit button is clicked. It >> >works fine with a normal one. >> > >> >sample: >> > >> ><? >> > if (!$submit) { >> >?> >> > >> > <form name="" method="post" action="<?php echo >> > $PHP_SELF ?> >> > <input type="text" name="username" size="20" >> > Class="Box"> >> > <input type="password" name="passwd" size="20" >> > Class="Box> >> > <input type="checkbox" name="remember" >> > value="1"> >> > <input type="image" >> >src="../News/themes/xFClan/button_submit.gif" >> >border="0" name="submit" value="Login" >> >width="55" height="19" >> >alt="Submit"> >> > </form> >> > >> ><? >> > } else { >> > echo "you clicked"; >> > } >> >?> >> > >> >If I use <input type="submit" ... > This works fine....do >I need to >> >do something else with the code? Help is very appreciated. >> > >> >Cheers. >> > >> > >> > >> > >> >-- >> >PHP General Mailing List (http://www.php.net/) >> >To unsubscribe, visit: http://www.php.net/unsub.php >> > >> > >> > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#142059) next »