Re: Re: PHP delete confirmation

From: Date: Fri, 29 Apr 2011 14:50:52 +0000
Subject: Re: Re: PHP delete confirmation
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-312570@lists.php.net to get a copy of this message
On 4/29/2011 12:06 AM, Geoff Lane wrote: > On Friday, April 29, 2011, admin@buskirkgraphics.com wrote: > >> Personally I would use the javascript page navigation is senseless if they >> miss click. > >> Javascript: Small and simple javascript. > >> onclick="return confirm('Are you sure you want to delete?')" > > Personally, I'd use Javascript and also check that the form was > submitted after the client-side check. So something like a hidden > field ('jstest') in the client-side form that is set to 1 by the > onClick event prior to showing the confirmation box. Then in the > handling PHP: > > if ($_POST['jstest'] == 1){ > // the client called us via Javascript::confirm, so we know the > // use really wants to delete > } else { > // We weren't called via Javascript::confirm, so we need to > // handle the confirmation in PHP > } > > HTH, > It wasn't a form, it was an HTML <a> tag

« previous php.general (#312570) next »