You can use an iframe instead of javascript (look in button.php to see the iframe that is written).
As for the submit.php process, if you aren't logged in and you go to submit.php?url=http://site.com then it will take you to the login page before you can submit a url. If a url already exists, you may want to add in a check at the start of submit.php for it. I use one that re-directs to the story page instead of submit, if the url is already in the database:
Code:
//if url already exists, go to story page
$check_url = mysql_real_escape_string(strip_tags($_GET['url']));
$link_query = mysql_query("SELECT link_id FROM " . table_links . " WHERE link_url='$check_url' AND link_status!='discarded'");
$link_rows = mysql_num_rows($link_query);
if($link_rows > 0) {
$link = mysql_fetch_array($link_query);
$id = $link['link_id'];
header('Location: story.php?id='.$id);
}