473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to delete emails using checkboxes

this is d code:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <?php
  4. $dbhost='localhost';
  5. $dbuser='root';
  6. $dbpass='';
  7. $db='country1';
  8. $connection=mysql_connect($dbhost,$dbuser,$dbpass) or die("unable to connect");
  9. mysql_select_db($db) or die("unable to select");
  10. session_start();
  11.  
  12. $_SESSION['userid']=$_COOKIE['userid'];
  13. $q=$_SESSION['userid'];
  14. $query="select * from inbox where receiverid='$q' GROUP BY (id) DESC";
  15. $result=mysql_query($query);
  16. if(!isset($_POST['submit']))
  17. {
  18. ?>
  19. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  20. <?php
  21. if(mysql_num_rows($result)>0)
  22. {
  23.     echo"<table border=0 cellpadding=0 cellspacing=0>";
  24.     while($row=mysql_fetch_row($result))
  25.     {
  26.         echo "<tr>";
  27.             echo "<td><input type='checkbox' name='chk1[]' value='' ></td>";
  28.             echo "<td><a href='abc.php?id=$row[0]'>$row[1] $row[2] $row[3]</a></td>";
  29.             echo "</tr>";
  30.  
  31.     }
  32.     echo "</table>";
  33. }
  34. ?>
  35. <input type="button" name="submit" value="delete">
  36. </form>
  37. <?php
  38. }
  39. else
  40. {
  41. $dbhost='localhost';
  42. $dbuser='root';
  43. $dbpass='';
  44. $db='country1';-
  45. $connection=mysql_connect($dbhost,$dbuser,$dbpass) or die("unable to connect");
  46. mysql_select_db($db) or die("unable to select");
  47. $c=$_POST['id'];
  48. if (sizeof(id)>0)
  49. {
  50. foreach($c as $ca)
  51. {
  52.     $query="select * from inbox where id='$ca'";
  53.  
  54.     $result=mysql_query($query);
  55.     if(mysql_num_rows($result)>0)
  56.     {    
  57.         while($row=mysql_fetch_row($result))
  58.         {
  59.         $q="insert into trash (inboxid,senderid,receiverid,subject,message,mdate) values ('$row[0]','$row[1]','$row[2]','$row[3]','$row[4]','$row[5]')";
  60.         }
  61.         $q1="delete * from inbox where id='$ca'";
  62.     } 
  63. }
  64. }
  65. }
  66. ?>
  67. </body>
  68. </html>
nothing happens when i check d checkbox n click delete button..pls rep as soon as psble n i'l b realy thnkful..

i need to store the content in trash table b4 deleting frm inbox..bt nothig of d two z hppng..
Aug 27 '10 #1
0 819

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: German | last post by:
Hi Team : I do no know the procedure to delete file using CFile ?? or any other way (command or procedure) to reach this action. Thanks in advanced
3
by: Mark | last post by:
I am looking for an example of using checkboxes in a repeater control where the checkbox state is persisted from page to page. Thank you, Mark
3
by: A | last post by:
Hi all! I would like to ask a question on sending emails... I have a web application that requires sending emails using email templates. The templates that I've made are separate HTML files...
0
by: Patrick.O.Ige | last post by:
I have a datagrid with checkboxes.. When a user clicks one check box and clicks the delete button it deletes that ROw. There another situation when a user clicks multiple rows so i had to loop...
4
by: Nicole | last post by:
I found this code below to use to send emails using VB with Outlook. However, it gives these errors. 'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem' and...
0
by: shameem | last post by:
hi 2 all, my question is how to delete the records by using checkboxes in datagrid. pls give reply to my question.
0
by: damimkader | last post by:
Hi, I'm trying to send emails using a Macro based on an Excel Sheet and the Email Client I'm using is Lotus Notes. OS used - Windows Xp. Language - VB Below is the Code I'm using for doing...
1
by: recordlovelife | last post by:
Hey guys, ill try to make this simple. I want to make a GUI for a client so that they can delete news entries that they have posted. I figure I can code a site that will query the table for the news...
7
by: Shani Aulakh | last post by:
Hi there, I have a FolderWatcher.cs class that will monitor a given folder and delete files older than X number of days. I have the following methods. I need to add/show delete mothod using date...
3
by: mdbi | last post by:
i have not declared any primary key of table and I want to delete row using gridview or formview. Is it possible?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.