Leatherback - many thanks for your suggestion. There is no $Post but there is $Get in the code. Here it all is if someone can spot the problem.
<?php
require_once("core/cms.core.php") ;
include("./includes/header.php");
?>
<?php
// Get the search variable from URL
$var = @$_GET['q'] ;
$trimmed = trim($var); //trim whitespace from the stored variable
// rows to return
$limit=10;
// check for an empty string and display a message.
if ($trimmed == "")
{
echo "<p>Please enter a search...</p>";
exit;
}
// check for a search parameter
if (!isset($var))
{
echo "<p>We dont seem to have a search parameter!</p>";
exit;
}
// Build SQL Query
$query = "Select manufacturer.manufacturer_name, manufacturer.manufacturer_id, font.font_id, font.font_name, font.price, font.font_file From font left Join font_family ON font.family_id = font_family.family_id left Join manufacturer ON font_family.manufacturer_id = manufacturer.manufacturer_id where font_name like \"$trimmed%\"
order by font_name"; // EDIT HERE and specify your table and field names for the SQL query
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
// If we have no results, offer a google search as an alternative
echo "<h1>You searched for: "" . $var . ""</h1>";
// next determine if s has been passed to script, if not use 0
if (empty($s)) {
$s=0;
}
// get results
$query .= " limit $s,$limit";
$result = mysql_query($query) or die("Couldn't execute query");
// display what the person searched for
// begin to show results set
$count = 1 + $s ;
// now you can display the results returned
?>
<div class="alphabet"> <strong>Alphabetical font search:</strong> <a href="/alphabetical-search.php?q=a">A</a> <a href="/alphabetical-search.php?q=b">B</a> <a href="/alphabetical-search.php?q=c">C</a> <a href="/alphabetical-search.php?q=d">D</a> <a href="/alphabetical-search.php?q=e">E</a> <a href="/alphabetical-search.php?q=f">F</a> <a href="/alphabetical-search.php?q=g">G</a> <a href="/alphabetical-search.php?q=h">H</a> <a href="/alphabetical-search.php?q=i">I</a> <a href="/alphabetical-search.php?q=j">J</a> <a href="/alphabetical-search.php?q=k">K</a> <a href="/alphabetical-search.php?q=l">L</a> <a href="/alphabetical-search.php?q=m">M</a> <a href="/alphabetical-search.php?q=n">N</a> <a href="/alphabetical-search.php?q=o">O</a> <a href="/alphabetical-search.php?q=p">P</a> <a href="/alphabetical-search.php?q=q">Q</a> <a href="/alphabetical-search.php?q=r">R</a> <a href="/alphabetical-search.php?q=s">S</a> <a href="/alphabetical-search.php?q=t">T</a> <a href="/alphabetical-search.php?q=u">U</a> <a href="/alphabetical-search.php?q=v">V</a> <a href="/alphabetical-search.php?q=w">W</a> <a href="/alphabetical-search.php?q=x">X</a> <a href="/alphabetical-search.php?q=y">Y</a> <a href="/alphabetical-search.php?q=z">Z</a></div>
<?php if ($numrows == 0)
{
echo "<div class=\"notfound\"><p>Sorry, your search returned 0 results</p></div>";
} else {?>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="resultstable">
<tr>
<th width="200"> </th>
<th width="324">Font Name </th>
<th width="200">Manufacturer</th>
<th width="90">Price</th>
<th width="30"> </th>
</tr>
<?php $col_color = 0 ;
if (mysql_num_rows($result) > 0)
{
while ($row= mysql_fetch_array($result))
{
if ($col_color % 2 == 0)
{
$col = "#ffffff";
}
else
{
$col = "#eeeeee" ;
}
echo '<tr>';
echo ' <td bgcolor="' . $col . '"><img src="/fontsample.php?text=EGOaegst&font_id=' . $row['font_id'] . '&font_file=' . $row['font_file'] . '" /></td>
<td bgcolor="' . $col . '"><a href="/font.php?id=' . $row['font_id'] . '">' . $row['font_name'] . '</a></td>
<td bgcolor="' . $col . '"><a href="/manufacturer.php?id=' . $row['manufacturer_id'] . '">' . $row['manufacturer_name'] . '</a></td>' ;
if (@array_key_exists($row['manufacturer_id'], $_SESSION['fixed_discounts']))
{
$row['price'] -= $_SESSION['fixed_discounts'][$row['manufacturer_id']]['amount'] ;
}
if (@array_key_exists($row['manufacturer_id'], $_SESSION['percentage_discounts']))
{
$percentage = $row['price'] * ($_SESSION['percentage_discounts'][$row['manufacturer_id']]['amount'] / 100) ;
$row['price'] -= $percentage ;
}
echo '
<td bgcolor="' . $col . '">£' . $row['price'] . '</td>
<td bgcolor="' . $col . '"><a href="/add_to_cart.php?font_id=' . $row['font_id'] . '" alt="Add to basket"><img src="/images/basket.gif" alt="Add to basket" /></a></td></tr>' ;
$col_color++ ;
}
}
}
?>
</table>
<?php
if ($numrows <> 0) {
$currPage = (($s/$limit) + 1);
//break before paging
echo "<br />";
// next we need to do the links to other results
if ($s>=1) { // bypass PREV link if s is 0
$prevs=($s-$limit);
print " <a href=\"$PHP_SELF?s=$prevs&q=$var\"><<
Prev 10</a>  ";
}
// calculate number of pages needing links
$pages=intval($numrows/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
if ($numrows%$limit) {
// has remainder so add one page
$pages++;
}
// check to see if last page
if (!((($s+$limit)/$limit)==$pages) && $pages!=1) {
// not last page so give NEXT link
$news=$s+$limit;
echo " <a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 >></a>";
}
$a = $s + ($limit) ;
if ($a > $numrows) { $a = $numrows ; }
$b = $s + 1 ;
echo "<p>Showing results $b to $a of $numrows</p>";
}
?>
<?php include("./includes/footer.php");?>