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'");
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.