That seems to be working- many thanks. It's forwarding to the speciofied page if the URL matches the db entry anyway so that's a big step forwards.
Many thanks for the pointers.
[Hmm... well it *was* working... but now in the testing echo I get this output:
SELECT showname FROM exhibitionstable WHERE showname = 'fixed.htc'
Where that comes from I've no idea as it certainly isn't in the database!
This is the current code:
<?php
include ('manager/exhibitions/inc/dbconnect.php');
$name = basename($_SERVER['REQUEST_URI']);
if(false!==strpos($name,'?'))
{
$name = substr($name,0,strpos($name,'?'));
}
$query = "SELECT showname FROM exhibitionstable WHERE showname = '". mysql_real_escape_string($name) ."' ";
echo $query;
$numresults=mysql_query($query) or die(mysql_error());
$numrows=mysql_num_rows($numresults);
if ($numrows == 0)
{
echo "<p>404 error</p>";
}
else
{
header('location: exhibitions.html');
exit;
}
?>
What's interesting if that it worked ONCE, I typed in
http://mydomain/travejl.html and travejl.html is an entry in the db) and it forwarded to exhibitions.html.
But now it just shows the output as above...