Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

cakephp excel/csv export component

Hello, If you want to add CSV export component using cake php, for that you can do by following steps:- First take the controller file and create an action, the code will go like this:- <?php class Export_my_dataController extend...

What is the equivalent to getLastInsertId() in Cakephp?

Hello if you want to get last insert id or something equivalent to this you can try following steps:- Lets take this example, Here I just inserted the field in column $data = array('menuName' =$_REQUEST['menuname']) $this->Menu...

What is a .ctp file used for in CakePHP?

CakePHP provides user to do advance view designing and making custom architecture for designing, for quick web developments. The CTP file extension is associated with the CakePHP. Ctp file contains template CakePHP template. It is as same as a...

How to get complete current URL using Cakephp Framework in PHP

If you need to print the complete current url you can do following steps. 1. In the view file code will go like this: <?php echo $this->here; ?> This syntax'll give you the absolute url starting from hostname i.e. /controller/...

Facebook login using CakePHP

To create a Facebook login using cakephp we need facebook app with appId, apiKey and secret key which are required for facebook login to work. Facebook connect and enables users to authenticate your application instantly with a Facebook Account. ...

PHP functions for applying user defined functions on array values.

There are two predefined functions in PHP for applying user defined function on each element of an array. 1. array_walk() : array_walk() applied a user function on each element of an array. It returns TRUE on success and FALSE on failure. The...

Submit form data in Ajax

We will learn here, how we can submit form data with the help of Ajax. First step:- Create index.html file and create a form with the three labels/fields:- Name,Email and Superhero Alias. Inside head tag we have included one css file and ...

How can we find the number of days between given two dates on php 5.3 and above

Hi if you are using php version 5.3 or greater then some functions are really very quick to write and use. In this blog I am calculating the days between your given two dates. This is by far the most accurate way of calculating the differenc...

Exceptions Handling in PHP

PHP 5 comes with an exception model similar to that of other coding languages. Exceptions are essential and supplies a better management around problem managing. Try - Operate utilizing an exception to this rule ought to be within a "try" obst...

Insert and Remove value from end of an array

This article demonstrate how to add and remove value on start and end of an array using predefined functions of PHP. The four important array functions in PHP are : 1. array_push() : This function is used to add one or more values to the end o...

Create a Log File in PHP

Log file is very helpful in debugging a large amount of data. We can create a Log file with the piece of code below :- $file = fopen ( "testfile.txt" , "a+" ); fwrite ( $file , serialize ( print_r ( $_POST , true ) ) ); fopen() is php in...

What is php.ini ?

The php.ini file also known as (configuration file) is where we declare changes for Php settings. If you want to use the default settings then you can use existing php.ini file for the server else change settings by editing the existing php.ini ...

Creating a custom password encrypt for Auth in laravel 5.0

Many times when we have an existing database with existing multiple records with set password, encrypted with a specific encrypt technique and then we try to immigrate to Laravel 5.0 and try to use Laravel Auth, it clashes. Since, Lara...

Use of Transaction in Mysql

Transaction is very useful in large rich applications such as eCommerce, Real Estate etc etc. It is mostly used in Customer Relationship Management (CRM), Enterprise Resource Plan (ERP). What is Transaction? When we need to execute more than ...

How to store constants in laravel 5.0

In laravel 5.0 the way to define constants and use them through out the project. Following are the steps to accomplish it:- Step 1st :- Creating a separate file under /config folder named as constants.php ( it can be any name) for storing all ...

Datatypes in PHP and String Functions - Tutorial 3

Datatypes supported by PHP String Integer Floating point Boolean Array Object NULL Resource String Functions Strlen() : Returns the length of a string (number of characters). <?php echo strlen("Hello world!"); // output...

How to Fill Dropdown using jquery without using Ajax

Step 1=> Get all the countries data in an array and all states data corresponding to country wise. <?php $countries_Array = array( 'IN' => 'INDIA', 'BG' => 'Belgium', 'AU' => 'Australia', ...

How to fix TCPDF file opening issue on smart devices

Hello Friends, If you are using TCPDF( A Plugin used to generate PDf files) then sometime you may face that this files are not opening in smart devices. You may see some garbage data instead of pdf file. Then do not worry, just put a exit; af...

Convert array to string in php

We can convert array to string using php predefined function named as implode(). Syntax for implode is: implode('separator',array); Example - $split_data [0] = 'This'; $split_data [1] = 'is'; $split_data [2] = 'a'; $split_data...

Convert a string to array in php

We can convert string to array using php predefined function named as explode(). Syntax for explode is: explode('separator',string); Example - $string = "This is a text"; $split_data = explode('',$string); // splitting by space as a...

Google Map Integration in PHP- Display Latitude and Longitude On Google Map

This code will point the Latitude and Longitude On Google Map with a marker. For this include a script: Here is the code hope it may help you somewhere <html> <head> <script type="text/javascript"...

How to rename php file

After discussing about open, read and copying PHP files we will be discussing about rename function. rename (): The rename() function is used for renaming a file or directory.It takes two parameters : 1.the original filename 2.the new...

Google Map integration in PHP to Calculate Latitude and Longitude

This code will calculate the latitude and longitude of the place in background on entering the place name. For integration of Google map to calculate Latitude and Longitude major script is : <script src="https://maps.googleapis.com/maps/...

Visibility Scope Of Variable And Functions

There are three type of visibility scope: Public Private Protected PUBLIC: Variable or function of public scope can be accessed throughout the program. PRIVATE : Variable or function of private scope can be accessed only with...

Add prefix to urls in CakePHP

CakePHP has power to do a lot with conventions by using routes. Its additionally possible to utilize custom prefixes adjacent to your admin routes for extra flexibility. Prefix routing can be enabled from within the core configuration file by set...

PHP filters to Sanitize and Validate data

Hello Readers , Today we will going to understand the concept of PHP filters to Sanitize and Validate data. PHP filters are used to validate and sanitize external input. Validating data = Determine if the data is in proper form. Sanit...

Using database session handling in Code PHP

PHP is one of the scripting language. In which session handling is one of the key thing mostly using in web application. Suppose you build a website and allow to login everyone in website, You need to track user every step until they log out o...

Inheritance in PHP

Hello Readers , Here's the explanation of concept of Inheritance in PHP. What is inheritance? Inheritance is nothing but a design principle in oop. By implementing inheritance we can inherit(or get) all properties and methods of one cla...

PHP Copy Files

How to open and read PHP files have been discussed in previous blog: http://findnerd.com/list/view/How-to-open-and-read-files-with-PHP/3157/ Now,we will discuss about copying a php file. In php,we can Copy files from source to destination...

How to upload two separate files in php

Hi if you want to upload two separate files from one single form to be uploaded and with a for simplest code Look at mine code. The form will have two separate input files but you need to name them common, ex 'files[]' I'm using 'upload[]' in ...

File Handling with JFile component in Joomla

JFile is the default library class for handling files upload, copy & delete functions. This can also be used to get the file name, extension and renaming a file while uploading. Following are the details of functions available that can...

How to compare PHP Variables and Arrays with null or empty values

Sometimes it is a bit confusing for developer to select right compare statement to check variables or arrays as there are lots of compare functions like "isset()", "!" operator, "is_null()", "empty()" etc. So we can use a straight forward appr...

How to open and read files with PHP

Before reading information from any file,we have to open the file for reading. This Blog will help you to find the code to read-open-close the file(s) on server we have created with PHP. Opening a file:fopen() This function enables t...

Indexed full text search in PHP-MySQL (PART - 2)

We already discussed Natural full text search in Indexed full text search in PHP-MySQL (PART - 1). Lets look into Boolean Full Text Search. In this we can use various operators to change the behavior of search. To specify a search to be b...

Indexed full text search in PHP-MySQL (PART - 1)

We need to write search queries every now and then in our projects. This is one of the most common tasks a PHP developer has to do. Most of the developers still use wildcard queries for this purpose which is very slow in searching records. Howeve...

Diffrence between unlink() and unset() in php

When we will use unlink() then this function will delete to file test.jpg from given path. PHP <?php unlink("image/test.jpg"); ?> When we will use unset() then this function will remove content initialized with the PHP variable...

How to resolve 'Creating default object from empty value' warning in CodeIgniter

Coder missed a very simple fix and general good practice that you should always initialize your object before you try to set a property. It is very simple fix for this is simply to add a new StdClass; call right before the error with the variable...

Diffrence between echo and print in PHP

Hello Readers! You might have heard these "echo" and "print" statement in PHP many times. So here we will understand now what is the exact difference of these two words. Both echo and print are used to output a statement. Below are the some...

Difference Between $a and $$a in PHP

$$a uses the value of the variable whose name is the value of $a. It means $$a is known as reference variable where as $a is normal variable. It allows you to have a variable of variable This program can create the variable name the same way i...

What is the difference between == and === in php

When comparing values in PHP for equality we can use either the == operator or the === operator. The == operator just checks to see if the left and right both values are equal. But, the === operator actually checks to see if the left and right va...

Stopping MySQL injection using Core PHP

What is SQL Injection? According to WIKIPEDIA: SQL injection is a code injection technique that exploits a security vulnerability occurring in the database layer of an application. A SQL injection attack exploits security vulner...

Swap two variables value without using third variable in php

Here is a method. How to swap two variables value without using third variable and temp variable. $a = 3; $b = 2; $a = $a + $b; // 3 + 2 = 5 $b = $a - $b; // 5 - 2 = 3 $a = $a - $b; // 5 - 3 = 2 print $a; print $b; Output: 2 3

How to configure database in Codeigniter

Hello Readers, In order to create any web application using Codeigniter framework or any other PHP framework we need to configure database . We have the database file inside application folder of a Codeigniter framework , inside application...

How to Install CodeIgniter in ubuntu

CodeIgniter can be installed in four easy steps on your ubuntu system: 1- Download CodeIgniter package and Unzip. Download link http://www.codeigniter.com/download 2-Upload the CodeIgniter folders and files to your server. Normally the inde...

ACL architecture in Joomla 3.x

Hello Readers, Today we are going to discuss the details about Access Control Lists (ACL) of Joomla 3.x Access Control List (ACL) specifies which users or system processes are granted access to objects, as well as what operations are allow...

12 Reasons to Choose PHP For Developing Website in 2015

Simplicity As we all know that PHP is quite similar to languages like Pearl and C, and it is extremely easy-to-use and learn that becomes the most beneficial thing about this wonderful language for programming. Any person no matter from whi...

REST API in joomla 3.4 with SLIM Framework PART 2

Flowing on from REST API in joomla 3.4 with SLIM Framework PART 1 it's time to to use the real power of Slim Framework. In this second part of tutorial series , we will use SLIM Framework in Joomla way of style to create powerful API. As we le...

How to Use Mandrill SMTP in LARAVEL 4?

Using Mandrill SMTP in LARAVEL4 is easy to use by following below changes in cofig/mail.php return array( /* |-------------------------------------------------------------------------- | Mail Driver |---------------------...

How to use IN condition in find query in yii

Below code will help you to use IN condition in find query in yii- $conditionsArray=array(1,2,3); $criteria->addInCondition("userid", $conditionsArray); $postdetails = Post::model()->findAll($criteria);
1 13 15
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: