Posts

Showing posts from May, 2011

Enable maintenance mode in magento

There is many times we need to put site into maintenance mode whenever you need to do any changes in the website Here i can show you how you can done this. For Magento version 1.4 and above: you just need to create a file named maintenance.flag in your Magento root. Then, your website automatically goes into maintenance mode and after completing your works you can comment or delete this file. If you want to edit some lines in maintenance template file. It is present in errors/default/503.phtml For Magento version 1.3 and below, - create a file called index.html in Magento root and write your maintenance messege in it, - write the following code in the beginning of index.php     <?php     // replace with your development IP     if ($_SERVER['REMOTE_ADDR']!=='127.0.0.1') {       header("Location: /index.html");       exit;     } Hope this help.! Cheers :)

PHP cURL functions

cURL is a library which allows you to connect and communicate to many different types of servers with many different types of protocols. it supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. A typical PHP cURL, follows the following sequesnce: curl_init – Initializes the session and returns a cURL handle which can be passed to other cURL functions. curl_opt – This is the main work horse of cURL library. This function is called multiple times and specifies what we want the cURL library to do. curl_close – Closes the current cURL sessio     curl_exec – Executes a cURL session. Download file or web page using PHP cURL: <?php $ch = curl_init(); //Initialize the cURL session    //Set the URL of the page or file to download. curl_setopt($ch,CURLOPT_URL, 'http://news.google.co.in/news?pz=1&cf=all&ned=in&hl=en&topic=t&output=rss' ); // Ask cURL to return the contents in a variable instead of simply echoing them to the bro