Home » Archive

Articles in the PHP Category

PHP »

[24 Oct 2017 | No Comment]

This article shows how you can scrap or fetch any webpage’s HTML content/data in PHP. We will use Simple HTML DOM Parser to scrap webpage content. You can download it from here: PHP Simple HTML DOM Parser – Sourceforge
You need to download the HTML DOM Parser from sourceforge and include simple_html_dom_parser.php in your PHP file.

PHP »

[17 Oct 2017 | No Comment]

This article shows how you can use MailChimp API v3.0 with PHP and CURL to add ecommerce data to your MailChimp campaign. When purchases happen in your shop then you can add your purchase order data to MailChimp to track purchases from your MailChimp Campaign. A MailChimp campaign is associated to any particular MailChimp list.
To add order data into MailChimp you need to follow the below steps sequentially:

Google, PHP »

[10 Oct 2017 | No Comment]

This article shows how you can get TimeZone name and id in PHP from latitude and longitude value by using Google Maps Time Zone API.
Note that: You need to put your API Key in the maps api url like this:
https://maps.googleapis.com/maps/api/timezone/json?location=$latitude,$longitude&timestamp=$time&key=xxxxxxxxxxxxxxxxxxxxx

Google, PHP »

[12 Sep 2017 | No Comment]

Here is a quick PHP code to fetch latitude and longitude of any given place using Google Maps API.
CURL is used to fetch data from the API URL.

Hope this helps. Thanks.

MongoDB, PHP »

[5 Sep 2017 | No Comment]

In this article, I will be presenting simple PHP & MongoDB code to add, edit, delete and view data. This kind of system is also referred to CRUD (Create, Read, Update, Delete).
Here is a step-by-step guide on creating a CRUD system using PHP & MongoDB:

PHP »

[5 Dec 2016 | No Comment]

This article shows how to create a simple pagination in PHP and MySQL.
In the example code present in this article:

– We will be fetching data from a MySQL database table.
– We will be showing certain rows of data in first page and other rows will be displayed in next pages.
– We will show the page numbers at the bottom of the page.

PHP »

[28 Nov 2016 | 4 Comments]

This article shows how to create a CRUD (Create, Read, Update, Delete) application in PHP & MySQL using PHP Data Objects (PDO). PDO is a PHP extension that provides an interface for accessing databases in PHP.
PDO is portable and powerful. There are many good features of PDO. The best one is that it’s cross-database compatible. You don’t need to change your query function if you switch database server for your project. PDO extension supports different databases like MS SQL, MySQL, Oracle, PostgreSQL, SQLite, etc.

PHP »

[7 Nov 2016 | 4 Comments]

This article shows how to create a simple CodeIgniter CRUD (Create, Read, Update, Delete) application with Login and Registration feature. CodeIgniter (CI) is a PHP framework that helps building a full-fledged web application.
This article is a continuation of my past article Simple CodeIgniter CRUD Application tutorial. The tutorial has add, edit, delete, and view feature but it didn’t contain login and registration feature.

Laravel, PHP »

[31 Oct 2016 | No Comment]

By default, you will see the following message in case any error occurs in your Laravel application:

Whoops, looks like something went wrong.
Whoops, looks like something went wrong.

To show the exact error message details, you need to follow the steps below:

Laravel, PHP »

[24 Oct 2016 | 2 Comments]

You might get the following error while trying to run Laravel for the first time.

Warning: require(/var/www/laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/laravel/bootstrap/autoload.php on line 17
Fatal error: require(): Failed opening required ‘/var/www/laravel/bootstrap/../vendor/autoload.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /var/www/laravel/bootstrap/autoload.php on line 17

Laravel, PHP »

[17 Oct 2016 | One Comment]

This tutorial shows step-by-step guide to install Laravel. Here, I will show two ways for installation. One is installing directly by composer create-project command and the other is by cloning or downloading Laravel from GitHub and then running the composer install command.
1) Method 1

PHP »

[10 Oct 2016 | 8 Comments]

This article shows how to create a CRUD (Create, Read, Update, Delete) application system with PHP & MySQL using Object Oriented Programming (OOP) technique. I had written an article before about creating Simple CRUD application with PHP & MySQL but that has been programmed with procedural way. In this article, we create the same kind of CRUD application using OOP.
First of all, we will create a new MySQL database. Let us name the database as ‘test‘.

PHP »

[22 Aug 2016 | No Comment]

This article shows how you can use MailChimp API v3.0 with PHP and CURL to manage MailChimp subscribers. This includes adding subscribers to a list, editing/updating subscribers in a list, adding subscribers to a category/group of a list, fetching and displaying list & list id and groups and groups id as well.
Getting your list ID

PHP »

[23 May 2016 | 11 Comments]

This article shows how to create a simple CRUD (Create, Read, Update, Delete) application with CodeIgniter. CodeIgniter (CI) is a PHP framework that helps building a full-fledged web application.
This article is a continuation of the basic tutorial present in the official CodeIgniter site. The tutorial had view and add data part. But, it didn’t contain the update and delete part. I have just added update and delete functionality in it.

Google, PHP »

[15 Aug 2015 | 11 Comments]

I was using ClientLogin method to access and update Google Spreadsheet. The ClientLogin method was in a deprecated state and now it has been turned off. We now need to use OAuth for authentication.
Google APIs Client Library for PHP enables you to work with Google APIs such as Google+, Drive, or YouTube on your server. In the example code below, I am using version 1.1.4 of this library.