Jump to content

PLEASE HELP!


dvidunis

Recommended Posts

hi, i wanted to make mail like but with mysql database, all is working i have single delete php that works, but i want multiple delete with checkboxes please help,notice: im newbie in php and 11 years old so please help :'(:

<?php
include ("template.php");
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("wmail") or die(mysql_error());
$to = $_SESSION['email'];
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM email WHERE account='$to'")
or die(mysql_error());
$result_num_rows = mysql_num_rows($result);
?>
<form method="post" action="searchinbox.php">Search: <input type="text" name="scontents"> <input type="submit" name="submit" value="Search"></form>
<?php
echo "<table border='3'>";
echo "<tr> <th>*</th> <th>From</th> <th>Subject</th> <th>Actions</th> </tr>";
// keeps getting the next row until there are no more to get
$rowcount = '0';
$unrowcount = '0';
while($row = mysql_fetch_array( $result )) {
           $bolt1 = "";
           $bolt2 = "";
           $numberzero = "0";
           $rowunread = $row['read'];
           if ($rowunread == $numberzero){

           $bolt1 = "<b>";
           $bolt2 = "</b>";
           $unrowcount++;
           }
           // Print out the contents of each row into a table
           echo "<tr><td>";
           echo "<input type='checkbox' name='checked'><br />";
           echo "</td><td>";
           echo "".$bolt1."".$row['sender']."".$bolt2."";
           echo "</td><td>";
           echo "".$bolt1."".$row['subject']."".$bolt2."";
           echo "</td><td>".$bolt1."<a href='http://5.4.206.216/wmail/message.php?id=".$row['id']."'>View</a> - <a href='http://5.4.206.216/wmail/delmail.php?id=".$row['id']."'>DELETE!</a></td></tr>".$bolt2."";
           $rowcount++;
}

echo "</table>";
$readcount = $rowcount-$unrowcount;
echo "You Have ".$rowcount." Mails in total, ".$unrowcount." Unread, ".$readcount." Read.";
if ($result_num_rows = 0)
  echo "<br><b>No mail!</b>";
$redirect = '<meta HTTP-EQUIV="REFRESH" content="0; url=http://5.4.206.216/Wmail/index.php">';
if (isset($_SESSION["email"]))
$redirect = '';
echo $redirect;
?>

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.