All pastes #451970 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-21 23:15 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The PassZone</title>
</head>
<center>
<body>
<?php 

if (isset($_GET['submit']) && isset($_GET['search']) && !empty($_GET['search'])) { 
     
$dbfile = 'file.txt'; 
$keyword = $_GET['search'];

	$lines = file($dbfile);
	$pattern = preg_replace("/\s+/", '|', preg_quote($keyword)); 
	$matches = preg_grep('#('.$pattern.')#i', $lines); 
	$go = "yes";
}
?>
<h1>THE PASSZONE</h1>Provided by <strong>#channel</strong> @ EFNET
<br />
<strong>Respected Owner:</strong> poppabear <br />
<br />
<form method="get" action="<?php $_SERVER['PHP_SELF']; ?>">
  <strong>Search keyword:</strong>  
  <input name="search">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<input type="submit" name="submit" value="Search"> 
</form>
<br />
<br />
<table width="46%" style="text-align:center; border:medium;" border="1" bordercolor="#000000">
  <tr>
    <td bgcolor="#CCCCCC"><strong>Results</strong></td>
  </tr>
  <tr>
    <td>
	<?php
	if ($go) {
		    foreach ($matches as $line_num => $line) {
    	 	   echo "<a href='$line' target='_blank'>$line</a><br />";
		    }
	}
	?>
	</td>
  </tr>
</table>

</body>
</center>
</html>