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

How to integrate MobBill Mobile payments for Video, Ringtones etc

Hi All, Here I am sharing how to implement MobBill Mobile payments, for this follow the steps below :- Step 1 -> You need to login into the link http://merchant.mobbill.com/insight/login/auth and create your account. Step 2 -> Now...

How to create an application using Facebook 4.0 SDK

To create a new Facebook application, register on https://developers.facebook.com and make a new application that will generate a Facebook application id and secret key which you will use in your development. After creating the application ope...

Create custom component in Joomla 1.5

Sometimes, when we are working on CMS like Joomla, Drupal etc, we have such requirements for which we need to build our own component. On that component, we can add our logics for development. Here are some basic steps to create you own Joomla...

Steps to create custom plugin in Joomla 1.5

There are some core plugins availabe in Joomla project for e.g. System, User, Search, authentication, content etc. Plugins provide a function which are associated with specific event trigger. In one of my project, I had a requirement to add pa...

How to Integrate iPayy(Payment gateway) API

IPayy API is basically a payment gateway by which you can sell anything through your website. In brief, it just generates an OTP number which is called as One Time Password and will send number via msg to your mobile. Here I am going to show t...

Setting up the Amazon Product Advertising API based on PHP SOAP

Hi all,for setting the amazon product API you will need amazon associates account and AWS account. Create the account using this link: http://aws.amazon.com/. After registration, generate `AWS_API_KEY` & `AWS_API_SECRET_KEY`. Download the A...

Prevent from text selection on double click of mouse.

Sometime you may need to prevent from text selection on double click of mouse button. You can use use the following css3 code for the same:- .monthReport label {-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-mo...

How to Create Simple Html File Through PHP Script

This tutorial show's how we can create a simple Html file through PHP script. if($filename == ''){ $filename = 'demo.html'; $writefile = ($filename , 'w'); $content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict...

Using Containable in CakePHP

Containable behavior was introduced in CakePHP 1.0. It helps you out to find out the data from the associated models/tables in a consistent way. Containable simplifies the binding operation in your model bindings. To use the new behavior, you...

PHP Script to import any excel database in MySql

Hello Friends, If you want to import any excel sheet to your My SQL database you can use the following code below. I have specified comments wherever needed.This is complete script and here you need to keep the classes directory with your cod...

How to Make a new CSV File Through PHP Script.

This tutorial show's how to create a new CSV file through PHP script. This script is more helpful for php developer to create a new CSV file in array formate. function functionname (parameter) { if (($handle = fopen("$data", "r")) !== ...

Setup Virtual Host

As the name suggested, Virtual Host is a technique to create a virtual URL of a website. For example on the local server we generally run a project like http://localhost/xyz but if you want to run this project like http://www.xyz.com on your loca...

Make file private in drupal 7

To make file access by permission in drupal 7, use 'private_files_download_permission' module. This module provide features to drupal developers to download files by specific roles. For example:- In my requirement,there are multiple resume in a f...

Custom redirection in drupal 7

Hello All, From the given blog below you will get to know about redirection of any form after submission or custom $form_state['redirect] in drupal 7:- First you need to override form_alter by usind drupal hook function hook_form_alter. To...

Code to validate ISBN10 or ISBN13

We seldom need a code to check whether the ISBN of book we are trying to search is a valid ISBN or not. So as to validate a provided ISBN we can use the below code for ISBN10 and ISBN13 respectively : Code for checking validity of ISBN10 : ...

Unexpected bheaviour of in_array in PHP

We have an associative array where its values are all Boolean and if we search for a string, we got true. Lets see an example. <?php $array = array( 'count' => 1, 'references' => 0, 'ghosts' => 1 ); var&#95;dump...

Laravel Framework

Recently Laravel framework has been launched in the market as I am not familiar with it, because still I have not worked on this framework but it seems to be one of the best MVC framework, below link provides you an average of mostly used/popular...

Getting location from latitude and longitude

If we have latitude and longitude with us and we need to get location name out of that from google api then we need to do the following code; public function findlocation($lat,$long){ $url&#95;data = 'http://maps.googleapis.com/maps/a...

Passing extra data with push notification

Sometime we do need to send additional data while sending Push-notification on iPhone , this can be easily achieved by adding following line to your code. But one should keep in mind that apple does have a limitation of 144 character while sendin...

Password hasing in CakePHP

CakePHP uses a Security class for hashing the passwords. I am writing some examples below that will definitely help you out in understanding the different ways of password hashing in CakePHP: echo "I am md5 CAKE:".Security::hash("dinesh","md5...

How to connect to your MySQL database from a PHP Script

Create simple Mysql connection with the help of PHP code <?php $hostname = 'localhost'; //define the hostname here $username = 'root'; //define the username here $password = ' '; ...

Problem with password encryption when moving from core php to cakePHP

Hi all, I had a requirement to move a project from core php to cakePHP framework. Migrating code was clear as I had to just modify syntax of code-base. But the problem came, when I had to implement login authentication with username and passwo...

Clean ugly HTML

CakePHP do help us a lot with its own 'Form' and 'HTML' helpers but it often outputs some very ugly and hard to read HTML. This little trick will make it a lot cleaner. Create a file named app_helper.php in your app's root directory. Ne...

Flaws of "and" and "or" operators in PHP

Today, When I was doing some programming stuffs and I found out that there is serious flaw in the and , or logical operator of PHP. Im not talking about the symbol || and && logical operator. Im talking about the and and or logical op...

Solution for error 'The requested address '/' was not found on this server' in cake PHP

If anyone face the error 'The requested address '/' was not found on this server' in cakePHP, then try these two steps:- Add function date_default_timezone_set() somewhere in you cake/app folder. If above solution not works then place date_...

Stop browser to cache image ,css, js in cakePHP

core.php (inside /app/config/) has lot of features that help us improve our web application. Configure::write(Asset.timestamp, force); Setting the Asset.timestamp to force will add a time value after every css,js and image tag in your HTM...

Unbinding Model in cakePHP

Lets say there are two models named as User and Post. A User hasMany Post, so in our User model we have a relation like this :- class User extends AppModel{ var $name = User; var $hasMany = array(Post=>array(foreignKey=>user&#95;...

Set php file permission on Shared server.

If you are getting an error of 404 not found/503 Internal server error on shared server, while you running any php project or any php file . Then reset permission of your php file to 644 . For testing create a index.php file and print '...

Using Email or Username to login with auth in cakephp

We seldom need to login into application using Email or Username while using Auth with Cakephp. To achieve this we either need to write customized Auth component or we can achieve the same with the following code : public function validateUs...

Form submit in javascript

I would like to share an interesting feature that I found as I was trying to submit form through JavaScript. If you are trying to "form.submit()" through javascript and any form elements present with the name of "submit" in it, then in that case...

Time Difference between two timezones - Php

Many a times we need to take out time difference between two time zone using Date class in php. We can use the following code :- $timeZone = ['Any Timezone']; $default = date("Y-m-d h:i:s A");// UTC $dateTimeZone =...

How to download any CSV file while working with PHP

/* Header file to includes. fopen is use to open a file in write mode here. fputcsv function is use to output the CSV file having the name of columns and data coming from database. */ header('Content-Type: text/csv; charset=utf-8'); header('...

Forming Tree structure in cakephp

Sometime you may need to form a tree structure from the values of the database table. For Ex- You may need to form a hierarchy of categories and subcategories like this: My Categories Fun Sport Surfing ...

Date difference between two timezones in PHP

Here is a short function to get the difference between two timezones in PHP:- function diff(){ $date1 = "2014-02-27T20:00:00+04:00"; $date2 = "2014-02-28T07:20:00+08:00"; $diff = abs(strtotime($date2) - strtotime($date1));...

Get timezone from address or zipcode or address

Hi, We can get user's timezone if we have only address or zipcode of that user. First of all we need to get latitude and longitude then using these lat and long we can get timezone. However this is 2 step approach but it is much accurate becau...

How to filter hasMany related model records in cakePHP when using find function?

Lets say we have models User and Friend related by User hasMany Friend relation. If we are required to pull out all users along with their female friends then how do we do that? Usually people think like this : $this->User->find('all...

What is Leverage Browser Caching and how to use it.

Here is the brief explanation of Leverage Browser Caching and how to use it to improve website performance. When a web browser i.e. Chrome, Firefox, Internet Explorer, Safari etc displays webpage it has to load several things like css files, j...

Set column name for auth component of users table

When we use Auth component for login in cake php then we are restricted to use 2 column in users table 'password' and 'username' .If we want to use our own column name then follow these steps: Step 1: Include the below function in YoursController...

In cakephp different session timeouts for admin and front end users

In cakephp you can handle different session time outs for admin and front end users.I added the following lines in core.php file and it works for me. if(strripos($_SERVER['REQUEST_URI'],"admin")) { Configure::write('Session', array( 'd...

Sending Mail in Joomla

Sending mail in Joomla is easy. It can be done by posting the value of form in view to the controller.php of that component. Function that can be used is function mail() { $fromname = JRequest::getvar('name'); $sender_mail = JR...

How to create profile page hiding controller and action name in yii

How to create profile page hiding controller and action name in yii In url manager add this line '<username:\w+>'=>'site/index', username will be the parameter for name or id and site is controller name and the url will be...

Remove wrapper from HTML element in cakePHP

In cakePHP, if you are using default render elements of cakePHP, then wrappers are automatically add. For removing wrappers from HTML element use the following syntax:- Form->input('email_address', array( 'div'=>false, 'labe...

Upload image through AJAX form in PHP

You can easily upload an image through form in PHP. You need to add JavaScript file for send image data on server side through AJAX. Please add query.form.js in your code. You may download this js file form following link: https:...

Image Rotation by image magic

Creating image rotation using Image magic by command line. Some time image taken from iphone when uploaded on the website gets rotated .We can easily find that the image is rotated and can rotate is back by using the following code. $rot...

Bind Model in cakephp

In one of my project I have two table with simple relation Division (id, title) - hasMany Staff Staff (id, division&#95;id, name, jobtitle) So. Now I need to get some info like: I need to get all Staff where birthday today, and get r...

Naming convention in cakephp

Naming convention in cakephp To get Maximum advantages from Cakephp then we need to follow some basic naming convention that cakephp rules says. Naming convention follows principles of following section of cakephp Database name Contr...

Pagination in joomla

The JPagination class allows developers to reliably and consistently add pagination to the Front-end and Back-end display of their components. The file containing the class can be found at /libraries/joomla/html/pagination.php. The construct f...

Check Email Already Exists with jQuery Ajax

While loginin website using email address many time you must have seen an error message say's Email already exists, So in this tutorial we will learn how to create a functionality in jQuerywhich checks if the email already exists and if yes t...

WP_Query for post pagination

Here is the code to get your posts pagination. Here you give the number of posts which you want to print in the every page. Chang something according your custom post type or other. // WP_Query arguments $paged = (get_query_var('pag...

WP_Query for post

Here is the code to get your custom post type posts. you can put something which you want to print like your post content, your post title, featured image and etc under the while loop. 'news', // Change news as your post type 'p...
1 42 44
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: