Make a script called remove_clone.php. Give it the ability to delete a  
row from your database if it receives a valid ID as a POST parameter.  
Have it return a 200 header if it succeeds, and a 500 if it fails.

For example --- untested:

//include the MyActiveRecord ORM
define('MYACTIVERECORD_CONNECTION_STR', 'mysql://user:p...@localhost/ 
class nameOfTable extends MyActiveRecord{}
//nameOfTable should obviously be just that -- the name of your  
database table
//this table must have as its primary key the column 'id',
//and that must be set as the auto-incrementing int(11) column type.
        if($record = MyActiveRecord::FindById('nameOfTable',$_POST['id'])){
                print 'deleted';
                header('HTTP/1.0 500 Server Error',true,500);

That's about as brief as I can make it. Naturally it is insecure, as  
anyone could craft a POST to it and delete rows from your database.  
But requiring a credential to allow deletes is left as an exercise...


On Jul 20, 2009, at 11:48 AM, Yan Kovyakh wrote:

>         new Ajax.Request('remove_clone.php',{

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to