Re: Delete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux