Welcome Guest, Not a member yet? Register   Sign In
How to delete records from DB using $_POST method
#9

[eluser]sdotsen[/eluser]
[quote author="Cristian Gilè" date="1296078707"]view:
Code:
<form method="POST" name="myform" action="/location/delete">

    <?php foreach($records as $record): ?>

       <input type="image" name="delete" value="<?=$record->id?>" src="path/to/your/delete_image" />  

    <?php endforeach; ?>

</form>

controller: (location/delete)

Code:
function delete()
{
     if(empty($_POST))
     {
        //redirect if no var was post
     }
    
     if($id = $this->input->post('delete'))
     {
         //delete entry in the database
     }

     ....
     ....
}


Cristian Gilè[/quote]

Is it possible to have text link rather than an image?


Messages In This Thread
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 08:27 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 09:25 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 09:29 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 09:42 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 09:44 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 09:47 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 09:48 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 09:51 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 10:00 AM
How to delete records from DB using $_POST method - by El Forum - 01-26-2011, 10:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB