Jump to content

[SOLVED] delete from mysql...a checkboxed item


contra10

Recommended Posts

i'm tryin to delete messages sent to an inbox... my code is

 

<?php
	echo "<tr>";
	echo"<td><Input type = 'Checkbox' Name ='checkbox' value ='$msgid'></td>";
 echo "<td align='left' width='10%' height='50'>";
echo"<a href ='http://localhost/profile/index.php?user=$friendid' ><img src='http://localhost/image/imagereplace.php?id=$friendid'></a>";
  echo "</td>";
	if ($bgcc == $colorvalue){
	echo"<td width= '90%' align='center' bgcolor='#DEDAD7'><a style='text-decoration:none' href ='http://localhost/inbox/message.php?msg=$msgid' >";
	}else{
		echo"<td width= '90%' align='center' bgcolor='black'><a style='text-decoration:none' href ='http://localhost/inbox/message.php?msg=$msgid' >";
	}
	echo"<FONT FACE='ariel' SIZE='3' color='#0094f7'><b>$title<br><br></font></td></tr>";
	echo "<tr><td></td><td></td>";
	echo "<td align='right' bgcolor='#DEDAD7'><FONT FACE='ariel' SIZE='2' color='#0094f7'>Sent by <b>$sendingusername</b> on $date</font></a></td>";
echo "</tr>";
}
?>
<input type="submit" name="delete" value="delete">
</table>
</form>
<?php

if (isset($_POST['checkbox']) and ($_POST['delete'])) { 

$checkboxid = mysql_real_escape_string($_POST['checkbox']);	
mysql_query("DELETE FROM inbox WHERE iid='$checkboxid'");
}
?>

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.