If I understand you correctly, you're asking how to hold the search information (what is being searched for) over multiple pages. The answer to this is fairly simple, you just place the search in the url, and obtain it using $GET. If you don't understand what I'm talking about I have written an article here that explains $GET and $_POST.
The first step of the change is as simple as adding "keyword=$title" (minus the quotes). So, for instance, the urls would change from:
$prev = " <a href=\"$self?page=$page\">[PREVIOUS]</a> ";
$first = " <a href=\"$self?page=$page\">[FIRST]</a> ";
to:
$prev = " <a href=\"$self?page=$page&keyword=$title\">[PREVIOUS]</a> ";
$first = " <a href=\"$self?page=$page&keyword=$title\">[FIRST]</a> ";
You might notice I used "&" to seperate page=$page and keyword=$title. In the browser this simple resolves to an ampersand (&), which is what should be placed between GET variables in a url.
Now, the second step involves a choice. You can either check for the presence of $GET['keyword'] in addition to checking for $POST['keyword'], or you can change your form to use GET and then only have to check for $_GET['keyword']. Unless you have a specific reason, I'd recommend the latter. To do this, you change the form code from:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="keyword">
<input type="submit" name="submit" value="submit">
</form>
to:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<input type="text" name="keyword">
<input type="submit" name="submit" value="submit">
</form>
All you have to do then is replace all of the instances of $POST['keyword'] in the code with $GET['keyword'].
I hope this answers your question. If you have any questions please do ask...I remember the challenges I faced when learning PHP so I'm happy to help 🙂