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
https://forums.phpfreaks.com/topic/213138-please-help/
Share on other sites

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.