All pastes #445890 Raw Edit

Stuff

public php v1 · immutable
·published 2007-04-18 04:21 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>Untitled Document</title></head><center><body><?php if (isset($_REQUEST['submit']) && isset($_REQUEST['search']) && !empty($_REQUEST['search'])) {      $dbfile = 'file.txt'; $keyword = $_REQUEST['search'];	$lines = file($dbfile);	$pattern = preg_replace("/\s+/", '|', preg_quote($keyword)); 	$matches = preg_grep('#('.$pattern.')#i', $lines); 	$go = "yes";}?><form method="get" action="<?php $_SERVER['PHP_SELF']; ?>"> <input name="search"> <input type="submit" name="submit"> </form><br /><br /><table width="46%" border="0" style="text-align:center;">  <tr>    <td>Results</td>  </tr>  <tr>    <td>	<?php	if ($_REQUEST['go']) {		    foreach ($_REQUEST['matches'] as $line_num => $line) {    	 	   echo "<a href='$line' target='_blank'>$line</a><br />";		    }	}	?>	</td>  </tr></table></body></center></html>