Jump to content

Recommended Posts

alright so everything here is functional except for the delete all check box doesnt select everything...and when you click the delete all button...that doesnt work either...sofar it seems that its just doing it in opera

 

<?php

include 'header.php';
if($_GET[action] == "deleteallmsgs"){
mysql_query("delete from messages where Recipient='$id' and new='no'")or die(mysql_query());
print "<center>All of Your Messages were Deleted.<br><a href=messages.php>Go Back.</a>";include "footer.php";exit;}
?>
<br><br>
<center> <a href="message_compose.php"> Compose a Message </a> | <a href="messages.php?action=deleteallmsgs"> Delete All Messages </a> 


<SCRIPT LANGUAGE=JavaScript>
function CheckAll()
{
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1)
    	{document.frm.elements[i].checked = 0; }
    else {document.frm.elements[i].checked = 1;}
}
}
function UncheckAll(){
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1)
    	{document.frm.elements[i].checked = 0; }
    else {document.frm.elements[i].checked = 1;}
}
}
</script>




<style type="text/css">
<!--
/* Terence Ordona, portal[AT]imaputz[DOT]com         */
/* http://creativecommons.org/licenses/by-sa/2.0/    */

/* begin some basic styling here                     */
body {

color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 10px;
padding: 0
}

table, td, a {
color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif
}

h1 {
font: normal normal 18px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 0 0 5px 0
}

h2 {
font: normal normal 16px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 0 0 5px 0
}

h3 {
font: normal normal 13px Verdana, Geneva, Arial, Helvetica, sans-serif;
color: #008000;
margin: 0 0 15px 0
}
/* end basic styling                                 */

/* define height and width of scrollable area. Add 16px to width for scrollbar          

*/
div.tableContainer {
clear: both;
border: 1px solid #b3a889;
height: 285px;
overflow: auto;
width: 635px;background-color:b3a889;
}

/* Reset overflow value to hidden for all non-IE browsers. */
html>body div.tableContainer {
overflow: auto;
width: 635px;background-color:b3a889;
}

/* define width of table. IE browsers only                 */
div.tableContainer table {
float: left;
width: 635px;background-color:b3a889;
}

/* define width of table. Add 16px to width for scrollbar.           */
/* All other non-IE browsers.                                        */
html>body div.tableContainer table {
width: 635px;
background-color:b3a889;
}

/* set table header to a fixed position. WinIE 6.x only                                       */
/* In WinIE 6.x, any element with a position property set to relative and is a child of  

     */
/* an element that has an overflow property set, the relative value translates into 

fixed.    */
/* Ex: parent element DIV with a class of tableContainer has an overflow property 

set to auto */
thead.fixedHeader tr {
position: relative
}

/* set THEAD element to have block level attributes. All other non-IE browsers         

   */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla 

browsers */
html>body thead.fixedHeader tr {
height:19px;display: block
}

/* make the TH elements pretty */
thead.fixedHeader th {
height:19px;
}

/* make the A elements pretty. makes for nice clickable headers                */
thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {
color: #FFF;
display: block;
text-decoration: none;
width: 635;height:19px;
}

/* make the A elements pretty. makes for nice clickable headers                */
/* WARNING: swapping the background on hover may cause problems in WinIE 

6.x   */
thead.fixedHeader a:hover {
color: #FFF;
display: block;
text-decoration: underline;
width: 630;

}

/* define the table content to be scrollable                                              */
/* set TBODY element to have block level attributes. All other non-IE browsers        

    */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla 

browsers */
/* induced side effect is that child TDs no longer accept width: auto                     */
html>body tbody.scrollContent {
height: 100%;
overflow: none;
width: 635;
}

/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/                             */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
height:19px;
}

tbody.scrollContent tr.alternateRow td {
height:19px;
}


-->
</style>


<style>
.maintable{
font-size:10px;
font-family:verdana;
color:#000000;
background:url(http://i41.tinypic.com/2yw60r6.jpg);
}
.msg{
font-size:8px;
font-family:verdana;
color:#000000;
background:url(http://i42.tinypic.com/25a5kpw.jpg);
}
.highlight{
font-size:8px;
font-family:verdana;
color:#000000;
background:url(http://i43.tinypic.com/6huwk6.jpg);
}
</style>


<?php 
if($_GET[action] == "delete"){print "The selected messages were deleted.<br><a href=messages2.php>Go Back.</a>";}
print "
<br><Br><form name='frm' method='post' action='messages2.php?action=delete'>
<input type='submit' name='massdelete' value='Delete Selection'>";
?>





<div id="tableContainer" class="tableContainer">
<table width=630 border="0" cellpadding="0" cellspacing="0">
<tr><td>

<table border="0" cellpadding="0" cellspacing="0" >
<tr height=19px>
<td class='maintable'  height=19px style='background-image: url(http://i43.tinypic.com/2eundbq.jpg);background-repeat: no-repeat; background-position: center center;'><img src='http://i43.tinypic.com/2eundbq.jpg'></td>
<td class='maintable' height=19px width=32>


<input type='checkbox' name='btn' onclick='CheckAll()'/>


</td>
<td class='maintable' height=19px width=50 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
From</td>
<td class='maintable'  width=235 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Subject</td>
<td class='maintable'  width=235 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Date</td>
<td class='maintable'  height=19px style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Status</td>
<td class='maintable'  height=19px style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
</form></td>
<td class='maintable'  height=19px style='background-image: url(http://i43.tinypic.com/2eundbq.jpg);background-repeat: no-repeat; background-position: center center;'><img src='http://i43.tinypic.com/2eundbq.jpg'></td>
</tr> </table>

</td></tr>
<tr><td>


<table width=635 border="0" cellpadding="0" cellspacing="0" >
<tbody class="scrollContent">

<?php

$sql="SELECT * FROM messages WHERE Recipient='$id' order by id desc ";
$result=mysql_query($sql);
$msgs=mysql_num_rows($result);

$checkbox = $_POST['checkbox']; 
if(!empty($checkbox)){
$massdelete = $_GET['massdelete'];

if(massdelete){
for($i=0;$i<$msgs;$i++){
$deleteid = $checkbox[$i];

mysql_query("delete from messages where id='$deleteid'");
//echo ("$checkbox<br>");  //display all msg ids deleted
}


}}

//and new='yes'
if($msgs == "0"){

print "<tr><td colspan=5><center>No Messages.</td></tr>";

}
for($i=0;$i<$msgs;$i++)
{	
$r=mysql_fetch_array($result);
$mid=$r["id"];
$Sender=$r["Sender"];
$Subject=$r["Subject"];
$Message=$r["Message"];
$Date=$r["date"];
$New=$r["new"];

if($New == "no"){$rou="Read";}
if($New == "yes"){$rou="Unread";}
if(empty($Subject)){$Subject="No Subject";}

//Sunday 6/18/2008 2:38pm
//$Date=str_replace(D n/j/y g:ia,$Date);

  echo "

<tr class='msg' class='scrollContent'
onMouseOver=this.className='highlight' onMouseOut=this.className='msg'>

<td width=29><input type=checkbox name='checkbox[]' value='$mid'></form></td> 
<td width=57><b><a href=player_individual.php?id=$Sender>#$Sender</a></b></td>
<td width=235><b><a href='message_viewindividual.php?id=$mid'>$Subject</a></b></td>
<td width=230><i>$Date</i></td>
<td><center><b>$rou</b></center></td>
</tr>
  ";
}
?>


</table>

</td></tr>
</tbody>
</table></div>
<BR><BR>

<?php

include "footer.php";

?>

Change this:

<?php
mysql_query("delete from messages where Recipient='$id' and new='no'")or die(mysql_query());?>

 

 

To This:

<?php
mysql_query("delete from messages where Recipient='$id' and new='no'")or die(mysql_error());
?>

Change this:

<?php
mysql_query("delete from messages where Recipient='$id' and new='no'")or die(mysql_query());?>

 

 

To This:

<?php
mysql_query("delete from messages where Recipient='$id' and new='no'")or die(mysql_error());
?>

 

I cant find this part? I dont see any of them that have ....(mysql_error());

?>

 

Updated: no errors but still not functioning

<?php

include 'header.php';
if($_GET['action'] == "deleteallmsgs"){
mysql_query("delete from messages where Recipient='$id' and new='no'")or die(mysql_query());
print "<center>All of Your Messages were Deleted.<br><a href=messages.php>Go Back.</a>";include "footer.php";exit;}
?>
<br><br>
<center> <a href="message_compose.php"> Compose a Message </a> | <a href="messages.php?action=deleteallmsgs"> Delete All Messages </a> 


<SCRIPT LANGUAGE=JavaScript>
function CheckAll()
{
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1;)
    	{document.frm.elements[i].checked = 0;}
    else {document.frm.elements[i].checked = 1;}
}
}
function UncheckAll(){
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1;)
    	{document.frm.elements[i].checked = 0;}
    else {document.frm.elements[i].checked = 1;}
}
}
</script>




<style type="text/css">
<!--
/* Terence Ordona, portal[AT]imaputz[DOT]com         */
/* http://creativecommons.org/licenses/by-sa/2.0/    */

/* begin some basic styling here                     */
body {

color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 10px;
padding: 0
}

table, td, a {
color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif
}

h1 {
font: normal normal 18px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 0 0 5px 0
}

h2 {
font: normal normal 16px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 0 0 5px 0
}

h3 {
font: normal normal 13px Verdana, Geneva, Arial, Helvetica, sans-serif;
color: #008000;
margin: 0 0 15px 0
}
/* end basic styling                                 */

/* define height and width of scrollable area. Add 16px to width for scrollbar          

*/
div.tableContainer {
clear: both;
border: 1px solid #b3a889;
height: 285px;
overflow: auto;
width: 635px;background-color:b3a889;
}

/* Reset overflow value to hidden for all non-IE browsers. */
html>body div.tableContainer {
overflow: auto;
width: 635px;background-color:b3a889;
}

/* define width of table. IE browsers only                 */
div.tableContainer table {
float: left;
width: 635px;background-color:b3a889;
}

/* define width of table. Add 16px to width for scrollbar.           */
/* All other non-IE browsers.                                        */
html>body div.tableContainer table {
width: 635px;
background-color:b3a889;
}

/* set table header to a fixed position. WinIE 6.x only                                       */
/* In WinIE 6.x, any element with a position property set to relative and is a child of  

     */
/* an element that has an overflow property set, the relative value translates into 

fixed.    */
/* Ex: parent element DIV with a class of tableContainer has an overflow property 

set to auto */
thead.fixedHeader tr {
position: relative
}

/* set THEAD element to have block level attributes. All other non-IE browsers         

   */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla 

browsers */
html>body thead.fixedHeader tr {
height:19px;display: block
}

/* make the TH elements pretty */
thead.fixedHeader th {
height:19px;
}

/* make the A elements pretty. makes for nice clickable headers                */
thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {
color: #FFF;
display: block;
text-decoration: none;
width: 635;height:19px;
}

/* make the A elements pretty. makes for nice clickable headers                */
/* WARNING: swapping the background on hover may cause problems in WinIE 

6.x   */
thead.fixedHeader a:hover {
color: #FFF;
display: block;
text-decoration: underline;
width: 630;

}

/* define the table content to be scrollable                                              */
/* set TBODY element to have block level attributes. All other non-IE browsers        

    */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla 

browsers */
/* induced side effect is that child TDs no longer accept width: auto                     */
html>body tbody.scrollContent {
height: 100%;
overflow: none;
width: 635;
}

/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/                             */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
height:19px;
}

tbody.scrollContent tr.alternateRow td {
height:19px;
}


-->
</style>


<style>
.maintable{
font-size:10px;
font-family:verdana;
color:#000000;
background:url(http://i41.tinypic.com/2yw60r6.jpg);
}
.msg{
font-size:8px;
font-family:verdana;
color:#000000;
background:url(http://i42.tinypic.com/25a5kpw.jpg);
}
.highlight{
font-size:8px;
font-family:verdana;
color:#000000;
background:url(http://i43.tinypic.com/6huwk6.jpg);
}
</style>


<?php 
if($_GET[action] == "delete"){print "The selected messages were deleted.<br><a href=messages2.php>Go Back.</a>";}
print "
<br><Br><form name='frm' method='post' action='messages2.php?action=delete'>
<input type='submit' name='massdelete' value='Delete Selection'>";
?>





<div id="tableContainer" class="tableContainer">
<table width=630 border="0" cellpadding="0" cellspacing="0">
<tr><td>

<table border="0" cellpadding="0" cellspacing="0" >
<tr height=19px>
<td class='maintable'  height=19px style='background-image: url(http://i43.tinypic.com/2eundbq.jpg);background-repeat: no-repeat; background-position: center center;'><img src='http://i43.tinypic.com/2eundbq.jpg'></td>
<td class='maintable' height=19px width=32>


<input type='checkbox' name='btn' onclick='CheckAll()'/>


</td>
<td class='maintable' height=19px width=50 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
From</td>
<td class='maintable'  width=235 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Subject</td>
<td class='maintable'  width=235 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Date</td>
<td class='maintable'  height=19px style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Status</td>
<td class='maintable'  height=19px style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
</form></td>
<td class='maintable'  height=19px style='background-image: url(http://i43.tinypic.com/2eundbq.jpg);background-repeat: no-repeat; background-position: center center;'><img src='http://i43.tinypic.com/2eundbq.jpg'></td>
</tr> </table>

</td></tr>
<tr><td>


<table width=635 border="0" cellpadding="0" cellspacing="0" >
<tbody class="scrollContent">

<?php

$sql="SELECT * FROM messages WHERE Recipient='$id' order by id desc ";
$result=mysql_query($sql);
$msgs=mysql_num_rows($result);

$checkbox = $_POST['checkbox']; 
if(!empty($checkbox)){
$massdelete = $_GET['massdelete'];

if(massdelete){
for($i=0;$i<$msgs;$i++){
$deleteid = $checkbox[$i];

mysql_query("delete from messages where id='$deleteid'");
//echo ("$checkbox<br>");  //display all msg ids deleted
}


}}

//and new='yes'
if($msgs == "0"){

print "<tr><td colspan=5><center>No Messages.</td></tr>";

}
for($i=0;$i<$msgs;$i++)
{	
$r=mysql_fetch_array($result);
$mid=$r["id"];
$Sender=$r["Sender"];
$Subject=$r["Subject"];
$Message=$r["Message"];
$Date=$r["date"];
$New=$r["new"];

if($New == "no"){$rou="Read";}
if($New == "yes"){$rou="Unread";}
if(empty($Subject)){$Subject="No Subject";}

//Sunday 6/18/2008 2:38pm
//$Date=str_replace(D n/j/y g:ia,$Date);

  echo "

<tr class='msg' class='scrollContent'
onMouseOver=this.className='highlight' onMouseOut=this.className='msg'>

<td width=29><input type=checkbox name='checkbox[]' value='$mid'></form></td> 
<td width=57><b><a href=player_individual.php?id=$Sender>#$Sender</a></b></td>
<td width=235><b><a href='message_viewindividual.php?id=$mid'>$Subject</a></b></td>
<td width=230><i>$Date</i></td>
<td><center><b>$rou</b></center></td>
</tr>
  ";
}
?>


</table>

</td></tr>
</tbody>
</table></div>
<BR><BR>

<?php

include "footer.php";

?>

get rid of all the crap in that code. just post the PHP, there is like a bunch of lines of CSS and a bunch of Javascript and HTML that I can't reference back and forth between the PHP that talks to each other. Another error i see is

if(massdelete){
for($i=0;$i<$msgs;$i++){
$deleteid = $checkbox[$i];

change it to

if($massdelete){
for($i=0;$i<$msgs;$i++){
$deleteid = $checkbox[$i];

 

Updated with both your guys changes: still not selecting all check boxes, or deleting any of the checked items and no errors.

 

Update:

<?php

include 'header.php';
if($_GET['action'] == "deleteallmsgs"){
mysql_query("delete from messages where Recipient='$id' and new='no'")or die(mysql_error());
print "<center>All of Your Messages were Deleted.<br><a href=messages.php>Go Back.</a>";include "footer.php";exit;}
?>
<br><br>
<center> <a href="message_compose.php"> Compose a Message </a> | <a href="messages.php?action=deleteallmsgs"> Delete All Messages </a> 


<SCRIPT LANGUAGE=JavaScript>
function CheckAll()
{
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1;)
    	{document.frm.elements[i].checked = 0;}
    else {document.frm.elements[i].checked = 1;}
}
}
function UncheckAll(){
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1;)
    	{document.frm.elements[i].checked = 0;}
    else {document.frm.elements[i].checked = 1;}
}
}
</script>




<style type="text/css">
<!--
/* Terence Ordona, portal[AT]imaputz[DOT]com         */
/* http://creativecommons.org/licenses/by-sa/2.0/    */

/* begin some basic styling here                     */
body {

color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 10px;
padding: 0
}

table, td, a {
color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif
}

h1 {
font: normal normal 18px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 0 0 5px 0
}

h2 {
font: normal normal 16px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 0 0 5px 0
}

h3 {
font: normal normal 13px Verdana, Geneva, Arial, Helvetica, sans-serif;
color: #008000;
margin: 0 0 15px 0
}
/* end basic styling                                 */

/* define height and width of scrollable area. Add 16px to width for scrollbar          

*/
div.tableContainer {
clear: both;
border: 1px solid #b3a889;
height: 285px;
overflow: auto;
width: 635px;background-color:b3a889;
}

/* Reset overflow value to hidden for all non-IE browsers. */
html>body div.tableContainer {
overflow: auto;
width: 635px;background-color:b3a889;
}

/* define width of table. IE browsers only                 */
div.tableContainer table {
float: left;
width: 635px;background-color:b3a889;
}

/* define width of table. Add 16px to width for scrollbar.           */
/* All other non-IE browsers.                                        */
html>body div.tableContainer table {
width: 635px;
background-color:b3a889;
}

/* set table header to a fixed position. WinIE 6.x only                                       */
/* In WinIE 6.x, any element with a position property set to relative and is a child of  

     */
/* an element that has an overflow property set, the relative value translates into 

fixed.    */
/* Ex: parent element DIV with a class of tableContainer has an overflow property 

set to auto */
thead.fixedHeader tr {
position: relative
}

/* set THEAD element to have block level attributes. All other non-IE browsers         

   */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla 

browsers */
html>body thead.fixedHeader tr {
height:19px;display: block
}

/* make the TH elements pretty */
thead.fixedHeader th {
height:19px;
}

/* make the A elements pretty. makes for nice clickable headers                */
thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {
color: #FFF;
display: block;
text-decoration: none;
width: 635;height:19px;
}

/* make the A elements pretty. makes for nice clickable headers                */
/* WARNING: swapping the background on hover may cause problems in WinIE 

6.x   */
thead.fixedHeader a:hover {
color: #FFF;
display: block;
text-decoration: underline;
width: 630;

}

/* define the table content to be scrollable                                              */
/* set TBODY element to have block level attributes. All other non-IE browsers        

    */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla 

browsers */
/* induced side effect is that child TDs no longer accept width: auto                     */
html>body tbody.scrollContent {
height: 100%;
overflow: none;
width: 635;
}

/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/                             */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
height:19px;
}

tbody.scrollContent tr.alternateRow td {
height:19px;
}


-->
</style>


<style>
.maintable{
font-size:10px;
font-family:verdana;
color:#000000;
background:url(http://i41.tinypic.com/2yw60r6.jpg);
}
.msg{
font-size:8px;
font-family:verdana;
color:#000000;
background:url(http://i42.tinypic.com/25a5kpw.jpg);
}
.highlight{
font-size:8px;
font-family:verdana;
color:#000000;
background:url(http://i43.tinypic.com/6huwk6.jpg);
}
</style>


<?php 
if($_GET[action] == "delete"){print "The selected messages were deleted.<br><a href=messages2.php>Go Back.</a>";}
print "
<br><Br><form name='frm' method='post' action='messages2.php?action=delete'>
<input type='submit' name='massdelete' value='Delete Selection'>";
?>





<div id="tableContainer" class="tableContainer">
<table width=630 border="0" cellpadding="0" cellspacing="0">
<tr><td>

<table border="0" cellpadding="0" cellspacing="0" >
<tr height=19px>
<td class='maintable'  height=19px style='background-image: url(http://i43.tinypic.com/2eundbq.jpg);background-repeat: no-repeat; background-position: center center;'><img src='http://i43.tinypic.com/2eundbq.jpg'></td>
<td class='maintable' height=19px width=32>


<input type='checkbox' name='btn' onclick='CheckAll()'/>


</td>
<td class='maintable' height=19px width=50 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
From</td>
<td class='maintable'  width=235 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Subject</td>
<td class='maintable'  width=235 style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Date</td>
<td class='maintable'  height=19px style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
|Status</td>
<td class='maintable'  height=19px style='background-image: url(http://i41.tinypic.com/2yw60r6.jpg);'>
</form></td>
<td class='maintable'  height=19px style='background-image: url(http://i43.tinypic.com/2eundbq.jpg);background-repeat: no-repeat; background-position: center center;'><img src='http://i43.tinypic.com/2eundbq.jpg'></td>
</tr> </table>

</td></tr>
<tr><td>


<table width=635 border="0" cellpadding="0" cellspacing="0" >
<tbody class="scrollContent">

<?php

$sql="SELECT * FROM messages WHERE Recipient='$id' order by id desc ";
$result=mysql_query($sql);
$msgs=mysql_num_rows($result);

$checkbox = $_POST['checkbox']; 
if(!empty($checkbox)){
$massdelete = $_GET['massdelete'];

if($massdelete){
for($i=0;$i<$msgs;$i++){
$deleteid = $checkbox[$i];

mysql_query("delete from messages where id='$deleteid'");
//echo ("$checkbox<br>");  //display all msg ids deleted
}


}}

//and new='yes'
if($msgs == "0"){

print "<tr><td colspan=5><center>No Messages.</td></tr>";

}
for($i=0;$i<$msgs;$i++)
{	
$r=mysql_fetch_array($result);
$mid=$r["id"];
$Sender=$r["Sender"];
$Subject=$r["Subject"];
$Message=$r["Message"];
$Date=$r["date"];
$New=$r["new"];

if($New == "no"){$rou="Read";}
if($New == "yes"){$rou="Unread";}
if(empty($Subject)){$Subject="No Subject";}

//Sunday 6/18/2008 2:38pm
//$Date=str_replace(D n/j/y g:ia,$Date);

  echo "

<tr class='msg' class='scrollContent'
onMouseOver=this.className='highlight' onMouseOut=this.className='msg'>

<td width=29><input type=checkbox name='checkbox[]' value='$mid'></form></td> 
<td width=57><b><a href=player_individual.php?id=$Sender>#$Sender</a></b></td>
<td width=235><b><a href='message_viewindividual.php?id=$mid'>$Subject</a></b></td>
<td width=230><i>$Date</i></td>
<td><center><b>$rou</b></center></td>
</tr>
  ";
}
?>


</table>

</td></tr>
</tbody>
</table></div>
<BR><BR>

<?php

include "footer.php";

?>

if($_GET[action] == "delete"){print "The selected messages were deleted.<br><a href=messages2.php>Go Back.</a>";}
print "

to

if($_GET['action'] == "delete"){print "The selected messages were deleted.<br><a href=messages2.php>Go Back.</a>";}
print "

 

based on what I just corrected, you need to go through your entire code and fix your syntax errors, and stop posting that super long code snippet. Just post the PHP please. We dont need to see the CSS or Javascript, unless they change the PHP some how

<SCRIPT LANGUAGE=JavaScript>
function CheckAll()
{
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1;)
    	{document.frm.elements[i].checked = 0;}
    else {document.frm.elements[i].checked = 1;}
}
}
function UncheckAll(){
count = document.frm.elements.length;
    for (i=0; i < count; i++) 
{
    if(document.frm.elements[i].checked == 1;)
    	{document.frm.elements[i].checked = 0;}
    else {document.frm.elements[i].checked = 1;}
}
}
</script>

 

<input type='checkbox' name='btn' onclick='CheckAll()'/>

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.