Validate user IP address using javascript

1. Read user IP address. var ip = '<!--#echo var="REMOTE_ADDR"-->' 2. Enter list of allowed ips var allowed_ips = ["",""] 3. Create a regular expression string. var handleips = allowed_ips.join("|") handleips = new RegExp(handleips, "i")

Send a mail using SMTP in PHP

1. First create a instance of smtp server. $smtp_server = fsockopen("", 25, $errno, $errstr, 30); 2. Check for errors while connecting to mail server. if(!$smtp_server) { // We have an error, do something exit; }

How to setup mongrel server on ubuntu

Goto terminal and type sudo gem install mongrel cd application_folder mongrel_rails start -d -p 8000 -a First line will install mongrel server, then go inside your application folder. Third line will start your mongrel server on port 8000. Now you can access your application on

Drupal setup

Following is a small howto for doing a setup of Drupal. You can find more details on 1. Download drupal and move the folder in /var/www/ 2. Grant write permissions on configuration file chmod o+w sites/default/ 3. Create database in mysql mysqladmin -u root -p create databasename create username and password for accessing the database

Syndicate content