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:
$name = basename($_SERVER['REQUEST_URI']);
$name = substr($name,0,strpos($name,'?'));
$query = "SELECT showname FROM exhibitionstable WHERE showname = '". mysql_real_escape_string($name) ."' ";
$numresults=mysql_query($query) or die(mysql_error());
if ($numrows == 0)
echo "<p>404 error</p>";
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...