    <?php
	  require_once ".../lib/viewer_functions.php";
      $options = array();                  // NOTE: see online documentation for more details on these options
      $options['tableName']  = 'blog';  // (REQUIRED) MySQL tablename to list record from. Example: 'article';
      $options['titleField'] = 'title';    // (optional) MySQL fieldname used in viewer url for search engines. Example: 'title' would display: viewer.php/article_title_here-123
      $options['viewerUrl']  = 'blogPage.php'; // (optional) URL of viewer page. Example: '/articles/view.php';
      $options['perPage']    = '1';         // (optional) The number of records to display per page. Example: '5'; Defaults to 10.
      $options['orderBy']    = 'byOrder, title';         // (optional) Fieldnames to sort by. Example: 'field1, field2 DESC, field3';
      $options['pageNum']    = '';         // (optional) Page number of results to display. Example: '1'; Defaults to number on end of url, then 1
  
	  $escapedKeyword = escapeMysqlString( @$FORM['keyword'] ); 
	  $options['where']      = '';
	  $options['where']      = "title LIKE '%$escapedKeyword%' OR 
								tags LIKE '%$escapedKeyword%' OR
								content LIKE '%$escapedKeyword%'"; 
	  
	  list($listRows, $listDetails) = getListRows($options); 
	  $scriptUrl      = $_SERVER['PHP_SELF']; 
	  $encodedKeyword = urlencode(@$FORM['keyword']); 
	  $listDetails['prevPageLink'] = "$scriptUrl?keyword=$encodedKeyword&amp;page={$listDetails['prevPage']}"; 
	  $listDetails['nextPageLink'] = "$scriptUrl?keyword=$encodedKeyword&amp;page={$listDetails['nextPage']}";	  
	  
    ?>

<?php echo "<?xml version='1.0'?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- change this to the title you want to appear in browser title bar -->
<title>search</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="dreamLogic" />
<meta name="description" content=" " />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="outer">
<div id="wrap">
<!-- the title that appear in the page header -->
<div id="title">Search</div>
<div id="header"></div>
<div id="navcontainer">
...
</div>
<div class="content">
<!-- here is your page content -->

<div class="pullquote">
...
</div>


<form method="get" action="<?php echo $_SERVER['SCRIPT_NAME'] ?>">
Keyword: <input type="text" name="keyword" value="" size="15">
<input type="submit" name="" value="Search">
</form>



 <!-- STEP2: Display Record List (Paste this where you want your records to be listed) -->

    <?php foreach ($listRows as $record): ?>
      Record Number: <?php echo $record['num'] ?><br/>
      Menu Order: <?php echo $record['menu_order'] ?><br/>
      Title: <?php echo $record['title'] ?><br/>
      Filename: <?php echo $record['filename'] ?><br/>
      Content: <?php echo $record['content'] ?><br/>
      Tags: <?php echo $record['tags'] ?><br/>
      link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a><br/>
    <hr/>
    <?php endforeach ?>

    <?php if ($listDetails['noRecordsFound']): ?>
      No records were found!<br/>
    <?php endif ?>

    <?php if ($listDetails['invalidPageNum']): ?>
      Results page '<?php echo $listDetails['page']?>' not found, <a href="<?php echo $listDetails['firstPageLink'] ?>">start over >></a>.<br/>
    <?php endif ?><br/>
  <!-- /STEP2: Display Record List -->




  <!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
    <?php if ($listDetails['prevPage']): ?>
      <a href="<?php echo $listDetails['prevPageLink'] ?>"><< prev</a>
    <?php else: ?>
      << prev
    <?php endif ?>

    - page <?php echo $listDetails['page'] ?> of <?php echo $listDetails['totalPages'] ?> -

    <?php if ($listDetails['nextPage']): ?>
      <a href="<?php echo $listDetails['nextPageLink'] ?>">next >></a>
    <?php else: ?>
      next >>
    <?php endif ?>
  <!-- /STEP3: Display Page Links -->


<!-- end page content -->
</div>
<div id="footer"><br />
<!-- it'd be super if you left this link intact -->    
<a href="http://www.dream-logic.com">Web Design by dreamLogic</a>
</div>
</div>
</div>
</body>
</html>