I have a confirm pop-up and if they click OK I want to call a php script. Not sure on how to do that. This is what I have so far:

function val_name()
var namePattern = /^[A-Za-z]{3,25}$/;
if( !namePattern.test(document.upload.fn.value))
alert("Enter valid first name");

if( !namePattern.test(document.upload.ln.value))
alert("Enter valid last name");

var x=document.forms["upload"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");

if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length)
alert("Not a valid e-mail address");
return false;

else if
(confirm("Are you sure you want to add this driver?")== true)
onClick = 'add_driver.php';