I believe you'd have to CHMOD the script (unless it's in your forum dir.) and then include global.php. Assuming your form is called "info", your Username field is named "user", and your Security Code field is named "sec_code", you could try this:
PHP Code:
$username =& $vbulletin->input->clean_gpc('p', 'user', TYPE_STR);
$sec_code =& $vbulletin->input->clean_gpc('p', 'sec_code', TYPE_STR);
if(isset($_POST[info])){
if (!$user = $db->query_first("SELECT username FROM dbtable WHERE username = '" . $db->escape_string($username) . "'))
{
echo "User Not Found!";
}
if (!$sec = $db->query_first("SELECT sec_code FROM dbtable WHERE sec_code = '" . $db->escape_string($sec_code) . "'))
{
echo "Incorrect Security Code";
}
}