cURL is a very powerfull system which allows us to transfer data across a wide variety of protocols. cURL is commonly used to send data across websites which includes API interaction. Using a cURL request, we can do the basic HTTP request, the more complex FTP upload or interaction with an authentication enclosed HTTPS site. In this section we will go through how cURL is intialized, how to send cURL request and close the requests.
Technical Solution
By default, all HTTP requests made out by cURL are GET requests. It simply fetches the URL and doesn't submit any POST variables. However, if we need to fetch and retrieve URL by the POST method with cURL, you will need the snippet below:
If you want know how to configure Google Analytics for your Drupal site checkout How to check Google Analytics on a Drupal website?. We can also get the analytics info from within a Drupal site. Read on to know how to view the Google Analytics report from within a Drupal site.
One of our Drupal clients had reported that the emails from the Google Apps mail accounts on their Drupal site were going into the spam folder of the recipients inbox. When we analyzed the situation we noticed that the SPF records for the domain were not set correctly. Read on to know how to add a SPF record through WHM to prevent mails from of your domain from going to the spam folder.
Check out how to define the levels of priority in software testing, explanation with examples.
If you use git as the version control system for your software projects be it Drupal or non-Drupal projects then there is a very good chance for you to have tried deleting branches locally. It is not very often that you have to delete branches from the remote repository. However when people delete branches from remote repositories these branches would still show up in local repositories of the developers. Here is how you handle this.
Did you face a situation where you wished that you could edit JavaScript live on the browser to make experimental changes in your code? Have you ever made modifications in JavaScript code without rewriting the file and reloading the web page to see the changes in real-time. Read on to know how to edit JavaScript code in your browser and see the changes in real-time?
I had a requirement where I had to execute shell command from PHP. The requirement was that I had to find details of a domain using commands like whois and then store this information into files in a folder. The only input parameter for the process was the name of the domain which was passed on from the Drupal site. The PHP function (shell_exec) was designed to do things like this.
We need to develop websites for a variety of mobile devices along with regular desktop versions. To do this effectively we need to detect the mobile devices when they access the website which can be done through Javascript. Read on to know how to detect mobile devices using Javascript
AJAX is now widely used in to web development to make the user interfaces simpler and faster. We may use AJAX to load images after page load in order to increase performance. However if you want to have a lightbox popup with the full image bound to an image loaded by AJAX then you might run into problems. You will find that even after linking the JS, CSS files and adding the rel="lightbox" attribute to the images it might not work.
We had encountered a situation on one of our Drupal sites where we had to create HTML links which on clicking should point to different locations on a different page. We solved this problem by making use of the 'name' attribute of anchor tags. If you are facing the same scenario in your Drupal site and would like to know how to use the 'name' attribute of anchor tags to redirect links to a location on a different page then read on to find out more.
A Drupal user trying to use Drupal Boost for caching their website encountered a strange situation in their Drupal site where enabling the Boost caching system increased the load of their server. If you are encountering a situation in your Drupal site where enabling the Boost caching system increases your server load. then read on to find the solution.
Two important aspects about managing multiple projects with multiple teams are scheduling of the projects & milestones and allocation of resources to these projects. Over the past few years we have been using a simple Google Spreadsheet based utility which we had developed in-house to schedule projects and to allocate resources for projects. We had earlier released this as Free Software under a GPL license and made this available as free template and over 1000 users are currently using this tool.
Colorbox can be used to display content pop-ups. By default, the popup's height and width will be exactly the same as that of the original content. But there may be times, when you want to load the content as per the screen height. This can be done easily using jQuery.
The steps you may follow to achieve this are:
Many a times, IE7 stands out from the group of modern web-browsers owing to its notorious incompatibility with many a standard HTML/CSS/JS. In this article, we are seeing the following case of incompatibility: CSS border for Select (Drop down) element does not work.
On one of my Drupal sites, while validating a form, when a required input field has not been filled before hitting the Submit button, an error message is shown, and the field is highlighted with a red border. The red border was achieved with this CSS:
Many a times, IE7 stands out from the group of modern web-browsers owing to its notorious incompatibility with many a standard HTML/CSS/JS. In this article, we are seeing the following case of incompatibility: In IE7, the CSS 'border-collapse' does not override cell spacing related tags.
While adding content using CKeditor in Drupal, users may add inline CSS to style the content. We can style each element in this content using our CSS to match the design of our site. In the case of table element, if we set HTML attribute cellSpacing on the table, like
Here is a script to help you find empty directories located under a specified parent-folder. The file folders.txt contains the list of folders that are to be passed as input to the script. The script will now check all the folders mentioned in the file folders.txt, and give the list of folders that are empty. The output can either be seen at the terminal or it can be passed to a file via a redirector.
Here is the code for the same:
This is a script to create a particular directory under all subdirectories in a parent directory. Consider the case when a parent directory consists of more than 100 folders and you want create a new folder under all these directories, with the same name. Doing this manually would be a mess. This script would help you do this in no time.
These are the steps for executing the script:
First, add the exact path where the parent directory is present, and the name of the folder that is to be created.
HP has published the price lists for its range of Pavilion Laptops for the month of January 2013.
The function of the script is to rename a specific-directory present under all sub-directories of a specified parent folder. Consider, you have a particular folder under all sub-directories of a folder and you want to rename all of those occurrences. Doing it manually would take much time. Here is a script to make it easy for you.
The script takes the following inputs:
'path' is the absolute path of the parent folder, and
'foldername.txt' is a text file which contains the names of the subdirectories under each of which the specific directory has to be renamed.