Hi bhalos,
There are slight problems with your syntax (the javascript part).
In order to increment the counter, a page request needs to be sent back to the page (a php page needs to be loaded).
To do this, you may want to include a tiny javascript pop-up that closes once it's loaded.
example:
#### Main page: main.php ####
<script language="Javascript">
function incrementBookmark()
{
window.open("increment_bookmark.php","popup","width=100,height=100");
}
</script>
<a href='javascript:window.external.AddFavorite(location.href,document.title); incrementBookmark();'>Click here to bookmark</a>
#### Pop-up: increment_bookmark.php #####
<?php
// codes to increment counter goes here
?>
<script language="Javascript">
this.close(); // Or output some text, e.g. "Thank you for bookmarking!"
</script>
--- END ---
Cheers,
Alvin.