I have two folders, one with pdf files starting with P in the Place folder, and the other with files starting with C in the Country folder.
If I use a link like
<a target='_blank' href='http//myhost.com/sort.php?trip=$row[trip_number]'>" . $row['trip_number'] . "</a>
And than in the sort.php script use this
$trip = (isset($_GET["trip"])) ? $_GET["trip"] : 0;
What can I use to take the $_GET["trip"] and redirect the request to the right folder and open the file in the parent window. I was thinking that the if statement might work like
if $trip = p*.pdf than redirect to place/$trip, if not redirect to country/$trip and if it cant find the file echo not on file and not the 404
but as you see I have no idea how to write it. Also any other way of doing this is fine if you have one. This is all I could come up with.... Thanks