Blogs

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 = ["11.11.11.11","22.22.22.22"] 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("smtp.yourdomain.com", 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 abc.com 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 http://abc.com:8000/controller_name

Drupal setup

Following is a small howto for doing a setup of Drupal. You can find more details on http://drupal.org/handbooks 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