[HTML+JS]Voting remainder pop up in 1 Window script

I would first do a php part, it checks if the ip is in the DB (in a MySQL DB), if the ip is in the DB, it does not show the popup, and whenever the user clicks on "Do not show this message again", it adds his current ip address to the DB. For the popup part, I would go for AJAX (it should not be hard to find a tut on Google).
 
I would first do a php part, it checks if the ip is in the DB (in a MySQL DB), if the ip is in the DB, it does not show the popup, and whenever the user clicks on "Do not show this message again", it adds his current ip address to the DB. For the popup part, I would go for AJAX (it should not be hard to find a tut on Google).

That's typically done with Cookies in JS, no?
 
Maybe like this
Code:
</div></div>
</div><div class="clear"></div></div>
       </script>
    <body spellcheck="false">
        <script type="text/javascript">



function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function createCookie(name,value,min) {
	if (min) {
		var date = new Date();
		date.setTime(date.getTime()+(min*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


window.onload = function vote_popup() {

	// w00t w00t HAX!
	var ver = getInternetExplorerVersion();
	if(navigator.appName == 'Microsoft Internet Explorer' && ver < 7.0)
	{
	return;
	}

	voted = readCookie('voted');

	if (voted == null) {
		document.getElementById('vote_popup').style.display = "block";
	}

}

function hide_vote_popup() {
	createCookie('voted','yes','10');
	document.getElementById('vote_popup').style.display = "none";
	document.getElementById('vote_popup').innerHTML = "";
};
</script>



<div id="vote_popup" style="background: transparent url(http://img212.imageshack.us/img212/9130/transbgiw4.png) repeat scroll 0% 0%; width: 100%; height: 100%; position: fixed; left: 0px; right: 0px; top: 0px; bottom: 0px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(240, 240, 240); font-size: 9px; text-align: center; z-index: 99999; display: none;"><div style="margin-top: 300px; width: 470px; margin-left: auto; margin-right: auto; display: block; background-color: rgb(0, 0, 0);"><p><font size="5">Click on the image to VOTE for Flyff Vicio, once you vote this popup will disappear for 12 hours.</font><a href="LINK_HERE" onclick="createCookie('voted','yes','720');" title=""><img src="IMAGE_HERE" style="border-color: rgb(0, 0, 0);" alt="" title="Flyff Vicio!" border="1"></a><br><span onclick="hide_vote_popup();"><br/><br/><font size="2" face="Tahoma" style="cursor: pointer">Remind me to vote in 10 minutes, bring me to Flyff Vicio</font></span></p></div></div>
 
Maybe like this
Code:
</div></div>
</div><div class="clear"></div></div>
       </script>
    <body spellcheck="false">
        <script type="text/javascript">



function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function createCookie(name,value,min) {
	if (min) {
		var date = new Date();
		date.setTime(date.getTime()+(min*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


window.onload = function vote_popup() {

	// w00t w00t HAX!
	var ver = getInternetExplorerVersion();
	if(navigator.appName == 'Microsoft Internet Explorer' && ver < 7.0)
	{
	return;
	}

	voted = readCookie('voted');

	if (voted == null) {
		document.getElementById('vote_popup').style.display = "block";
	}

}

function hide_vote_popup() {
	createCookie('voted','yes','10');
	document.getElementById('vote_popup').style.display = "none";
	document.getElementById('vote_popup').innerHTML = "";
};
</script>



<div id="vote_popup" style="background: transparent url(http://img212.imageshack.us/img212/9130/transbgiw4.png) repeat scroll 0% 0%; width: 100%; height: 100%; position: fixed; left: 0px; right: 0px; top: 0px; bottom: 0px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(240, 240, 240); font-size: 9px; text-align: center; z-index: 99999; display: none;"><div style="margin-top: 300px; width: 470px; margin-left: auto; margin-right: auto; display: block; background-color: rgb(0, 0, 0);"><p><font size="5">Click on the image to VOTE for Flyff Vicio, once you vote this popup will disappear for 12 hours.</font><a href="LINK_HERE" onclick="createCookie('voted','yes','720');" title=""><img src="IMAGE_HERE" style="border-color: rgb(0, 0, 0);" alt="" title="Flyff Vicio!" border="1"></a><br><span onclick="hide_vote_popup();"><br/><br/><font size="2" face="Tahoma" style="cursor: pointer">Remind me to vote in 10 minutes, bring me to Flyff Vicio</font></span></p></div></div>
Exactly wat i needed , thanks

i wish there was a thanks button in this section xD
 
Back