How to Install Apache Mod Rewrite on Ubuntu / Linux

By | August 8, 2020

Apache Mod Rewrite mod_rewrite is an apache module which enables rewriting of urls requested by client before the pages are fetched by apache. For example www.site.com/products.php?code=459 can be written as www.site.com/products/459 or www.site.com/products/459.html. The second url is re-written into the first one by mod_rewrite using rewrite rules specified in the .htaccess file. Enable Mod Rewrite… Read More »

Get real IP address of user in php

By | December 4, 2008

Client IP address Php applications are mostly web based and often need to get the ip address of the user who is connecting to the application. Ip address is required for various logging purpose, geolocation service etc. The most common way to get the ip address of a remote user is by using the superglobal… Read More »

Remote Login with Curl PHP

By | November 19, 2008

Remote login with CURL The curl extension of php can be used to open remote webpages by both GET and POST methods. There are many situations when you need a php script to login into a website and open a certain page. For example when you are writing a bot or web scraper. To login… Read More »

How to Create Excel files in php with csv and tsv format

By | July 31, 2020

Database applications written in php often need to export data for reporting purpose. A popular export format is excel. Excel is a spreadsheet that lays out data in a grid format. Excel itself is a microsoft proprietory format. There are many libraries available for php like Spreadsheet_Excel_Writer pear package etc that can do the job…. Read More »

Execute an sql script in jdbc

By | April 4, 2008

The SQL Script should have comments starting with – or — only on new lines and each command should end with a ; . Reading a sql file and putting all of it in a string variable and feeding to the execute command would result in an exception. All instructions must be executed individually. A… Read More »

Read write and save configurations to a file in java

By | April 2, 2008

Configuration files are used in applications to store settings, user preferences and other configuration parameters of an application so that. When configurations are changed from within the application these need to be saved so that next time the application starts with these new settings. In Java reading and writing to a configuration is pretty simple… Read More »