<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <?php $rowcount = 0; $resulthtml = ""; $where = ""; if(isset($_GET['action'])) { if($_GET['action'] == 1) { if(isset($_POST['txtDateFrom'])) { if(strlen($_POST['txtDateFrom']) > 5) { if(strlen($where) > 0) $where = $where . " AND RecDate >= '" . $_POST['txtDateFrom'] . "'"; else $where = "RecDate >= '" . $_POST['txtDateFrom'] . "'"; } } if(isset($_POST['txtDateTill'])) { if(strlen($_POST['txtDateTill']) > 5) { if(strlen($where) > 0) $where = $where . " AND RecDate <= '" . $_POST['txtDateTill'] . "'"; else $where = "RecDate >= '" . $_POST['txtDateTill'] . "'"; } } if(isset($_POST['txtMessageID'])) { if(strlen($_POST['txtMessageID']) > 0) { if(strlen($where) > 0) $where = $where . " AND YahooMessageID = '" . $_POST['txtMessageID'] . "'"; else $where = "YahooMessageID = '" . $_POST['txtMessageID'] . "'"; } } if(isset($_POST['txtUser'])) { if(strlen($_POST['txtUser']) > 0) { if(strlen($where) > 0) $where = $where . " AND FromUser like '%" . $_POST['txtUser'] . "%'"; else $where = "FromUser like '%" . $_POST['txtUser'] . "%'"; } } if(isset($_POST['txtMessage'])) { if(strlen($_POST['txtMessage']) > 2) { if(strlen($where) > 0) $where = $where . " AND (Subject like '%" . $_POST['txtMessage'] . "%' OR Message like '%" . $_POST['txtMessage'] . "%')"; else $where = "(Subject like '%" . $_POST['txtMessage'] . "%' OR Message like '%" . $_POST['txtMessage'] . "%')"; } } $link = mysql_connect("localhost", "USERNAME", "PASSWORD") or die(mysql_error()); mysql_select_db("name-database") or die (mysql_error()); $query = "SELECT YahooMessageID, Subject, FromUser, RecDate FROM archive WHERE " . $where . " ORDER BY YahooMessageID desc"; $result = mysql_query($query, $link) or die(mysql_error()); while($row = mysql_fetch_row($result)) { $resulthtml.=<<<EOD <tr class="softfill"> <td align="right"> <a href="javascript:;" onClick="window.open('http://launch.groups.yahoo.com/group/name-yahoogroup/message/{$row[0]}', '', 'width=800, height=600, location=no, menubar=no, scrollbars=yes, resizable=yes, status=yes, toolbar=no');">Yahoo</a> | <a href="javascript:;" onClick="window.open('message.php?yahoomessageid={$row[0]}', '', 'width=800, height=600, location=no, menubar=no, scrollbars=yes, resizable=yes, status=yes, toolbar=no');">$row[0]</a> </td> <td>$row[1]</td> <td>$row[2]</td> <td>$row[3]</td> </tr> EOD; } $rowcount = mysql_num_rows($result); mysql_close($link); } } ?> <html> <head> <title>name-database archive</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="styles.css" rel="stylesheet" type="text/css"> </head> <body> <p> </p> <form action="search.php?action=1" method="post"> <table width="800" height="100%" border="0" align="center" cellpadding="8" cellspacing="0" class="maintable"> <tr> <td height="50" valign="top" bgcolor="#FFCC00"> <table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/header.gif" width="400" height="50"></td> </tr> </table> </td> </tr> <tr> <td height="400" valign="top" bgcolor="#FFFFFF"> <h5 class="softfill">Enter search criteria</h5> <table width="600" border="0" cellspacing="2" cellpadding="4"> <tr> <td width="171" align="right" class="softfill bold">Subject/Message</td> <td width="413"> <input name="txtMessage" type="text" id="txtMessage" size="50" maxlength="50"> </td> </tr> <tr> <td width="171" align="right" class="softfill bold">User</td> <td width="413"> <input name="txtUser" type="text" id="txtUser" size="50" maxlength="50"> </td> </tr> <tr> <td width="171" align="right" class="softfill bold">Message ID [Number] </td> <td width="413"> <input name="txtMessageID" type="text" id="txtMessageID" size="20" maxlength="8"> </td> </tr> <tr> <td width="171" align="right" class="softfill bold">Date</td> <td width="413"> from <input name="txtDateFrom" type="text" id="txtDateFrom" size="15" maxlength="20"> till <input name="txtDateTill" type="text" id="txtDateTill" size="15" maxlength="20"> (format <span class="bold">yyyy-mm-dd</span>)</td> </tr> <tr> <td align="right"> </td> <td> <input type="hidden" name="txtType" id="txtType" size="1" maxlength="1" value="1"> </td> </tr> <tr> <td align="right"> </td> <td> <input type="submit" name="Submit" value="Go!"> <input type="reset" name="Reset" value="Clear"> </td> </tr> </table> <h5 class="softfill"><?php echo($rowcount); ?> query results:</h5> <?php //echo($where); ?> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr bgcolor="#FFCC00" class="bold"> <td width="100" align="right">Message ID</td> <td >Subject</td> <td >From</td> <td width="140">Date</td> </tr> <?php echo($resulthtml); ?> </table> </td> </tr> <tr> <td height="40" align="center" bgcolor="#FFCC00"> Copyright mixfreaks.nl © 2004 | <a href="http://www.mixfreaks.nl" target="_blank">www.mixfreaks.nl</a> </td> </tr> </table> </form> <p> </p> </body> </html>