Thanks again guys.

Here's the code that is working on my test server:
Code:
<?php
$username="";
$password="";
$database="";
if ($_GET['p'])
{
$p = intval($_GET['p']);
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$result=mysql_query("SELECT postid FROM " . vb3_ . "post
WHERE importpostid = $p");
$postid = mysql_result($result,0,"postid");
header("Location: http://www.domain.com/testvb/showthread.php?p=" . $postid . "#post" . $postid);
}
else if ($_GET['t'])
{
$t = intval($_GET['t']);
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$result=mysql_query("SELECT threadid FROM " . vb3_ . "post
WHERE importthreadid = $t");
$threadid = mysql_result($result,0,"threadid");
header("Location: http://www.domain.com/testvb/showthread.php?t=" . $threadid);
}
?>
I'm not sure how secure this is, but I'll try to adjust it to standard vB formatting before putting it on the live server.
Thanks to you guys, I can keep my old links working. This should tide me over until I (or Jelsoft) come up with a solid script to replace the old links in the database.