Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

January 5, 2009

Block IP Address Script

Use this script to block certain IPs from your webpage, by redirecting them to another site. Note that your web server must have SSI enabled (most Linux servers do), with the page using the correct extension (ie: .shtml) in order for this script to work. Furthermore, since this script relies on JavaScript to block the user (by redirecting the person to another site), if he/she disables JavaScript in the browser, the script will become futile.Just insert the below script to the HEAD section of your page, and enter your list of IPs to block:<script type="text/javascript">//Enter list of banned ips, each separated with a comma:var bannedips=["23.23.23.23", "11.11.11.11"]var ip = '<!--#echo var="REMOTE_ADDR"-->'var handleips=bannedips.join("|")handleips=new...

June 10, 2008

Displaying RSS Feeds Easily Using Google Ajax Feed API

Displaying RSS feeds from other sites (ie: CNN or Digg) on your own is a nice way to show constantly updated content automatically. However, for the novice web developer, setting this up can be daunting, requiring both knowledge from you and your server's ability to host remote files. Google's Ajax Feed API changes all that, by basically enabling any webmaster to display RSS feeds on their sites using some JavaScript code. It hosts the desired RSS feeds on their servers for you, caches them, and returns the data in either JSON or XML format for you to utilize. All that's left is for you to use some JavaScript to parse this data and output it on your page.In this tutorial, we show you how to harness Google Ajax Feed API to fetch a RSS feed and...