Monthly Archives: February 2010

Javascript – jQuery – Click Counter

0
Filed under javascript, jquery
Tagged as , , , ,

Author: slac3dork
Site: http://snippet.c0de.me
Summary: Click counter with jQuery framework.

<html>
  <head>
    <title>Twitter like text area</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
    <script type="text/javascript">
      $(function(){
          var total_click = 0;
          $("#clickMe").click(function(){
            total_click = total_click + 1;
            $("#counter").text("Total Click: " + total_click);
return false;
          });
        });
    </script>
  </head>
  <body>
    <form>
      <div id="counter">Total Click: 0</div><br />
    <a id="clickMe" href="#">click me!</a>
  </form>
  </body>
</html>



javascrip,logo,badge,pixel badge

PHP – Redirecting Malicious IP Address

0
Filed under php
Tagged as , , , , ,

Author: slac3dork
site: http://snippet.c0de.me
summary: PHP code to redirect user from malicious IP address

<?php 

/**
  _________      .__       .____   _______
 /   _____/ ____ |__|_____ |    |  \   _  \    ____
 \_____  \ /    \|  \____ \|    |  /  /_\  \  / ___\
 /        \   |  \  |  |_> >    |__\  \_/   \/ /_/  >
/_______  /___|  /__|   __/|_______ \_____  /\___  /
        \/     \/   |__|           \/     \//_____/  

http://snippet.c0de.me

slac3dork@gmail.com
*/

/* Replace this with your IP address.. */
$malicious_ip = '127.0.0.1'

if ($_SERVER['REMOTE_ADDR'] == $malicious_ip) {
header("Location: http://www.example.com/");
}
?>



php,logo,pixel badge,badge