I have it sorted, something I thought of which I should have
thought in the beginning.
Leave the login as is and redirect to a page that can solve
the query.
<?php
if ($row_rsvote['vercode'] == 'voted'){
header("Location: booksubmit.php");
}else{
header("Location: result.php");
}
?>
Problem solved.
Thank you all for your help!