Codeigniter

Two “Google searches” for open source code

If you are looking for code from an open source project, you should try Google’s code search engine. It searches thousands of projects for snippets and files. Sourcegraph, our second tool tip, can do that too. Open source projects, such as those resulting from Google’s regular summer of code events, have had…

Read More

March 17th, 2020 Angular Js, Articles, Codeigniter, Google API, Interview, News, Tech News, Tutorials, Web Design, Wordpress

List files in directory in Codeigniter a php framework

You can use directory helper of codeigniter. To load helper use $this->load->helper(‘directory’); and use directory_map() function to read the directory path specified in the first parameter and builds an array representation of it and all its contained files. Example: $map = directory_map(‘./mydirectory/’); Note: Paths are almost always relative to your…

Read More

March 6th, 2020 Codeigniter, Interview, PHP, SolveIt, Tutorials

What is Lorem ipsum and where does it come from?

Where does Lorem ipsum come from? (Graphic: Shutterstock / IrenD) Everybody has already read or even used “Lorem ipsum” somewhere. But where exactly does the phrase come from and what should it mean? “Lorem ipsum dolor sit amet” are probably the most widely used words on the web. But almost no one knows…

Read More

October 7th, 2018 Android, Articles, Branding, Codeigniter, Design, Interview, iOS, Javascript, Linux, Magento 2, News, PHP, SEO, Tech News, Tutorials

Are PDO prepared statements sufficient to prevent SQL injection?

The short answer is NO, PDO prepares will not defend you from all possible SQL-Injection attacks. For certain obscure edge-cases. I’m adapting this answer to talk about PDO… The long answer isn’t so easy. It’s based off an attack demonstrated here. The Attack So, let’s start off by showing the…

Read More

May 2nd, 2018 Amazon Linux, Codeigniter, Databases, Laravel, Linux, MySQL, PHP, Tutorials, Ubuntu

How can you prevent SQL injection in PHP?

By Using prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL. You basically have two options to achieve this: Using PDO (for any supported…

Read More

May 2nd, 2018 Articles, Codeigniter, Databases, Laravel, MySQL, PHP, Tutorials

MongoDB for PHP Developers – A Beginner’s Guide

Introduction If you want to create a website using MongoDB and PHP, this article will help you to: Connect to a MongoDB database Save documents in a collection Query documents in a collection Perform range queries Sort documents, update a document, delete one or more documents from a collection What…

Read More

March 15th, 2017 Amazon Linux, Articles, CentOS, Codeigniter, Databases, Linux, MongoDB, MySQL, PHP, Tutorials, Ubuntu

How to use Database Transactions in Codeigniter ?

In order to use transactions in your database queries. You need to use Codeigniter’s transaction methods provided by db library of Codeigniter. The basic snippet is as follows: $this->db->trans_start(); # Starting Transaction //Do your Stuff Here i.e. Queries you wants to run on database $this->db->trans_complete(); # Completing transaction if($this->db->trans_status() ===…

Read More

August 4th, 2016 Codeigniter, Databases, Interview, PHP

World’s Countries, States and Cities database

There are many Database providers which are charging us for providing the Databases of various types. One of them is very important and useful database is for world’s all countries,State and Cities. Every time when we plan to create a website then we stuck on one point that is how…

Read More

March 26th, 2016 Codeigniter, Databases, MySQL, PHP, SEO

Array vs Object when returning data

Prefer Using Objects when returning large amount of data When returning large data, it can be obvious to use Arrays. But Arrays make poor object-to-object data transfer mechanisms in object-oriented programming. Objects are main focus of  Object-oriented programming and it should be. This means that each array should be converted…

Read More

January 4th, 2016 Codeigniter, Javascript, jQuery, MySQL, PHP

Embed Photo Sphere in website

I have written in my blog ever thought about the possibility to include 360 ​​° images with JavaScript in a web site. At that time the whole thing was based on the Web viewer by Joe Simpson. Meanwhile, Google has published its own method. For this purpose, Google has published…

Read More

December 28th, 2015 Codeigniter, Google API, Javascript, jQuery, PHP, Uncategorized, Wordpress

Codeigniter : Adding Header and Footer automatically

A developer don’t really enjoy writing same line of code again and again. In Codeigniter we normally load same view templates in every controllers. e.g. $this->load->view(‘templates/header’); $this->load->view(‘body’); $this->load->view(‘templates/footer’); But it is possible to add templates header and footer automatically whenever we load any view to controller. For this we needs…

Read More

December 28th, 2015 Codeigniter

Profiling Codeigniter website to get database queries count and optimize website speed

Clients often complains that their website speed is slow. One of the most common reason was a large number of database queries that get executed for every single page, sometimes more than thousand queries for a single page. In this article, I will explain how to figure out whether the…

Read More

December 16th, 2015 Codeigniter, MySQL, PHP