Re: Delete
| From: | Richard Lynch | Date: | Mon, 05 Jun 2006 16:44:14 +0000 |
| Subject: | Re: Delete | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237412@lists.php.net to get a copy of this message | ||
On Sat, June 3, 2006 8:40 pm, George Babichev wrote:
> Hello everyone! I wrote a blog application, but now for the admin
> panel, i
> am trying to add a feature to delete blog posts. It would show the
> title of
> the post next to it, and have a delete link which would delete it. How
> would
> I do this? I mean if I have multiple blog entry's, how would I delete
> them
> without using php my admin?
The blog entries should all have a unique ID, such as an
auto_increment, and you would embed that in the delete form:
<form><input type="submit" name="delete[<?php echo
$blog_entry_id?>]"
value="Delete!" /></form>
In the processing page:
<?php
if (isset($_POST['delete'])){
list($blog_entry_id) = each($_POST['delete']);
$blog_entry_id = (int) $blog_entry_id; //sanitization
}
?>
--
Like Music?
http://l-i-e.com/artists.htm