my form action usually looks like this

some.php?action=update&ID=1

my update will look like update table set *** where _rowid=$_GET['ID']

so therefore its globally used. i'd use the id from the get var

but i guess in the delete function i could place this within the update
action so

case 'update':
delete(tablename);
update(tablename);
break;

i dont tend to like this becuase it'll be in the same action which is why i
tried the location.href way to send it to a different action, as both the
update and delete buttons are within the same form, i'm sure u could have a
delete button in a list although this leads to problems as users generally
would like the delete button in the update/view screen so they know exactly
what they are deleting so therefore which is why the buttons are in the
same form, any ideas ?


> [EMAIL PROTECTED] wrote:
>
>> apologies i generally use this system for deleting records, i give a
>> confirm box if they press ok it goes to another action, i suppose i
>> should change this system to submit the form instead and check for the
>> post var ? i guess at least it could store the http_referer then :\
>
> If you're talking about presenting a list of records and using a button
>  to delete a record, then you should use a method such as this...
>
> <input type="submit" name="delete[xx]" value="Delete">
>
> Where "xx" is the record_id (or equivalent). Then, when the form is
> submitted, you just look for $_REQUEST['delete'], make sure it's an
> array, grab the key using key(), and delete that record.
>
> Simple, eh? :)
>
> If you want an easy method for presenting a list of records and radio
> buttons for each record with different statuses (like open, closed,
> pending, delete, etc), and handling the status changes, check out my
> column in the latest issue of php|architect. :)
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> --
> 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

Reply via email to