Posts

Showing posts from 2014

Drupal Memcache setup

Image
Memcached Figure 1. The Memcached client library is responsible for sending requests to the correct servers. Step 1: Application requests keys foo, bar and baz using the client library, which calculates key hash values, determining which Memcached server should receive requests. Step 2: Memcached client sends parallel requests to all relevant Memcached servers. Step 3: Memcached servers send responses to the client library. Step 4: Memcached client library aggregates responses for the application. Install Memcache with Drupal: Windows XP: a. Install the Memcached Service Download memcached binaries for Win32 from http://jehiah.cz/projects/memcached-win32/ Unzip the binaries in a directory (eg. c:\memcached) Run the command “c:\memcached\memcached.exe -d install” for installing the service. Start the server using “c:\memcached\memcached.exe -d start” Server will be listening to port ...

Simple excel export using PHP

Step 1. Add the below header(code) in excel.php file.  header("Content-type: application/xls");  header("Content-Disposition: attachment; filename=user.xls");  header("Pragma: no-cache");  header("Expires: 0"); Step2 : Construct a HTML table and assign to a php variable. $test="<table  cellspacing='0' cellpadding='0' border='1'> <tr> <td><b>Email</b></td> <td><b>Created</b></td> <td><b>First name</b></td> <td><b>last name</b></td> <td><b>Sign up</b></td> </tr>"; $test .="<tr> <td><b>abc@gmail.com </b></td> <td><b>17th Jan 2013</b></td> <td><b>Romel</b></td> <td><b>Christopher</b></td> <td><b>1</b></td> </tr></table>"; Step...