Jump to content

[SOLVED] 1 Form 2 Locations


supanoob

Recommended Posts

sorry my heads all over atm...

 

this is the code that checks the 2 buttons

 

<?php

if ($_GET['step'] == 'save_delete')
{
//delete them
if ($_POST['submit'] == 'delete')
{
$ids_to_delete = $_POST['ids_to_delete'];

//Run the delete-query for each entry in the $ids_to_delete array
foreach($ids_to_delete as $id_to_delete) {

$sql2="UPDATE mail SET mail_deleted='1' WHERE mail_id='$id_to_delete'";
if(mysql_query($sql2));

$sql2="UPDATE accounts SET mail=mail-1 WHERE account_id='$account_id'";
if(mysql_query($sql2));

}
echo "Checked Items Deleted.";
}

//if wanting to save
if ($_POST['submit'] == 'save')
{
$ids_to_delete = $_POST['ids_to_delete'];

//Run the delete-query for each entry in the $ids_to_delete array
foreach($ids_to_delete as $id_to_delete) {

$sql2="UPDATE mail SET mail_saved='1' WHERE mail_id='$id_to_delete'";
if(mysql_query($sql2));

}
echo "Checked Mail Saved";
}

}

?>

 

and this is the code that has the buttons

 

<?php

<input type=\"submit\" value=\"Delete Checked\" name=\"delete\"> <input type=\"submit\" value=\"Save Checked\" name=\"save\"></form></center><br><br>";


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.