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

stdClass in PHP

"stdClass" is an void class of PHP. It can be as a act of the alternative of a associative array but works only on PHP 5 and more Any associative array. You thought it of a object as same in java or python. $info = array("question" => "sc...

How to get selected number of indexes/key from a array

If you need to get some limited key values of an array then you can use function array_slice used in PHP Let see the example I'm having an array of 400+ values $exp = array("34", "45", "45", "554", "2".......); Now I'm limiting my thi...

How to remove blank spaces from Request using recursive in CakePHP

Removing the white spaces from a string is a easy task, but for doing this in whole of you website you need the recursive function in Cakephp The 'array_walk_recursive()' will recursively get the request(GET/PUT) data and remove the white/blan...

What are the different errors in PHP

There are basically 4 different type of errors in Php. Parse Error It stops the execution of php script . Commonly caused due to syntax mistakes in codes E.g. Unclosed single double quotes, missing parentheses or adding extra parentheses...

General idea how ATM Machine Works

This blog will help the readers to understand that how ATM machine dispatches the money. Lets have a look on the ATM code in PHP: <?php $amount = $_REQUEST['amount']; $rupees = array(1000,500,100,50,20,10); $count = array(0,0,0,0,0); ...

How to correct error "Header already sent"

Hello readers. On developing the website the error 'Header already sent' is very likely to occur. This is cause by PHP when it receives outputs like echo or html tags now it can take the data but then further passing it to HTTP will be very diff...

How to add watermark in image using PHP script.

Hi guys ,it really helps to add watermark on images . In this code you will see that we get the position of watermark .png image where you want to place then copy to the watermark image on the main images. /* * PHP GD * adding watermark to a...

How to sort table columns using Table Sorter

Follow the given steps: 1) Add the script in your page <script type="text/javascript" src="/path/to/jquery-latest.js"></script> <script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script> 2) I...

Play youtube video on web page and remove references of other youtube videos at the end of video

Hello Readers, When we play a video on our webpage at the end of the of video it provides reference links of other videos so, if you want to play video and do not want to provide any reference links, below code will make this possible. **H...

How to delete duplicate rows in a table set MySql

Hello readers!. If you having the much of redundant/duplicate data growing in your database you can delete it with just a single query as I wrote here. Let say I have a table Address and want to delete the all the duplicate records whose city...

How to use caching in codeigniter

Web page caching Lets we use the caching in codeigniter to achieve the maximum performance. While CodeIgniter is quite fast, the amount of dynamic data you display in your hypertext pages will correlate directly to the server resources, memory...

How to get specific part of a URL

Hi Readers! If you having a useful URL and want to extract the specific part from it you learn the logic below Lets have a example $yoururl = "http://www.abc.com/usefulinfo/"; Here I'm getting only the /usefulinfo/ word. For getting th...

PHP Code to connect to MongoDB

To connect MongoDB with PHP you need to install MongoDB php driver. After you successful install MongoDB php driver, you need to create connection with MongoDB. MongoDB default port is 27017. To connect with localhost and default port $conn...

Introduction to Cookies and Sessions in PHP

What is a Cookie? A cookie can contain different data that is stored on the client browser with server specific information like user id and or user preferences. What are Sessions? Sessions are used to store information in the form of va...

Installing PHP module on Apache2

One can install PHP with apache2 in two ways, either by compiling from source code or from repositories by using a package manager. Both ways are discussed below. Installing from repositories : This is very simple and straight forward method ...

FirePHP

Debugging means finding out the bugs.We all need to be sure that our applications is bug free, so here we have another tool for debugging our application that is "FIREPHP". Firephp is a Firefox extension, similiar to FireBug. It enables you t...

Retrieve WordPress root directory path?

Wordpress provides different powerful functions which are useful for different prospective. We are going to discuss one function named get_home_path(). Through this function we can get the path of root directory in your wordpress setup. We can si...

How to pass a variable from php to javascript

Hello reader! There are mane ways to pass a variable from one technology to another technology but if you do want to use PHP, always encode with json_encode before outputting. lets see this quick example <script> var jsvariable ...

Send an Email using email component in cakephp

Hello reader if you want to send email using the email component in cakephp you need to run the email component of cakephp ex You should place email send routine in your AppController: function _sendMail($to,$subject,$template) { $th...

How to calculate distance from Latitude and longitude

Hello readers!, If you are having a project in PHP and need to calculate the distance from lat and longs you can use the code below:- Here all the entries are saved in table('business') (SELECT name, ACOS(SIN(RADIANS($latitude))*SIN(RADIANS...

How to get any File Name to PHP File using Command Line?

In Ubuntu system, first check for the PHP. For checking open the terminal, using command **Ctrl +Alt +T** and type whereis php If PHP present in system, above command display the path of PHP Make a PHP file from where you can acce...

File Handling in PHP - Tutorial 8

This blog explains about various functions used for File Handling in PHP.

Date and Time in PHP - Tutorial 7

This blog explains different functions used for date and time manipulation in PHP.

Debugging techniques for PHP programmers

Error messages area unit your 1st line of defense as a developer. you do not need to be developing code in PHP on a server that's not organized to show error messages. However, confine mind that once your code is debugged and prepared to travel ...

eliminate php5 Strict standards errors

Hello readers! If you have recently upgraded you PHP from PHP 5.3 to PHP 5.4 . Then it might be possible that your script is displaying a lot of error messages. If you want to hide these error you just need to change in your cakephp setup Th...

Integrating Twitter with Magento

Social media... Now a days social media is a part of life or requirement of time. We are here to discuss integration of twitter with magento. We all have twitter account. Am I right?. We can integrate twitter to magento with different ways. Like ...

Creating Non Default Themes in Magento

Welcome to this blog. Today we are going to discuss non-default themes in magento. We all knows magento is a powerful eCommerce platform where you can easily build your stores. If you want to work on magento then you need to understand it's fil...

How to Use AJAX in a WordPress Shortcode?

We are going to process ajax request in wordpress shortcode on button click. First of all you need to add the shortcode in wordpress. Kindly write below code in function.php <?php function callback_listing($atts, $content = null) { e...

OAuth 2.0 Authentication on Wordpress site

We are here to discuss OAuth 2.0 Authentication in wordpress. Do you know about OAuth?. What is OAuth?. OAuth is nothing but a open protocol which is useful to allow authorization by easy and secure methods from web/mobile/software applications. ...

Rename files during upload within Wordpress backend

If you want to rename the file name at the time of upload, it is a right place to know the solution. Let's discuss this requirement. We all know there are many hooks available in Wordpress. We will use the filter named sanitize_file_name. You ...

Wordpress: How to call a plugin function with an ajax call

In web development field we face different situations in order to fulfil the requirements. Sometimes we have to customize the well managed CMS/frameworks. Today we are going to take an sample example of wordpress plugin development. There is one ...

Page Processing in PHP

PHP has three types of modules which are as following. A) Core PHP : This modules handles requests, error handling as well as file streams. B) Zend Engine: It convert the php code into machine tokens or opcode and it will execute it in a vi...

autocomplete function with php

Jquery is a powerful library and it is heart of web develepment. It includes different types of functions. Today we are going to discuss function named autocomplete() which is useful to auto populate the suggestions as user types, filtering a...

jQuery Ajax POST with PHP

In jquery we have function named ajax() which have two arguments such as url and settings. Settings are a set of key/value pairs that configure the ajax request. This argument is optional. We are going to take an small example to understand the...

How to make custom error pages in CakePHP 2.0

Hello reader! If you want to set a custom error webpage for your whole cakePHP project you can set this page at /views/layouts/default.ctp as layout for these error pages like 404/ page not found To customize it and set your own message, o...

How to use Bootstrap pagination with CakePHP pagination helper

Hello, if you are using pagination with cakephp framework and want to change the view of pagination just like twitter bootsrap then you can do this by doing follow changes in you view and css. We can do it by writing some custom classes in view ...

Find where field is not null in cakephp

Hello Readers! if you have a database table "users" which has a field "email". And you are looking for a query that fetch out every email field only which are not null in cakephp Here is the following code below you can use, and its working ...

How to get Latitude/longitude from address in PHP

Hello All, In this blog we will discuss about how to fetch the lat/long from the given address in PHP. So we will be using curl request for fetching the same via using Google maps api. Below is the code, you can use to generate lat/long...

Find method with JOIN in CakePHP

Hello, if you are working on cakephp and you need the joins with find method here is an example. Here $my_joins is and array having multiple join cases in other different arrays inside it. $my_joins=array( 'joins' =&g...

How to Add a prefix to every URL in CakePHP?

Hello Reader! If you looking to fix a default language prefix for your all url in cakePhp then you can follow the steps which is the easiest and clean way :- Open file routes.php from the location Config/routes.php There in first line wri...

How to Install DebugKit on CakePHP

Hello Nerds! If you are going to develop a new project in cakephp then you might need Debugkit for that, and its really a lifesaving tool for rapid developments. You can install DebugKit using doing the following steps as:- Step 1:- You ne...

Functions and Arrays in PHP - Tutorial 5

This tutorial explains User Defined functions in PHP. It also explains Array, there types and how to iterate through arrays.

CakePHP 2.0 with Twitter Bootstrap

Hello nerds, If you want to start your new CakePHP project with Twitter Bootstrap set with it, you can follow the steps as following:- Step 1: You need to Download CakePHP and Twitter Bootstrap versions. You can easily download them from ...

How Cake PHP redirect with parameters in url

Hello readers, If you are using cakephp and want to redirect user to any other page/controller with some passing values in url, Well cakephp provides you its own syntax written in php, check bellow example: $this->redirect( arra...

How to create global variables in CakePHP?

The majority of the developers, develop skepticism in which, what's the correct place/Page in which they should declare the constant variable in cakephp. Previous going to variable declaration, we must consider that any of us will work over a ...

Why I switched from CakePHP to Symfony2

CakePHP or Symphony2? This is a common question that are arising in the developers community and topic lists this may lead developers sometimes get undermine to clarify users as which is the best framework in php. Lets talk about Symphony2...

base_url in CakePHP

Hello if you want current base url(Include Domain) or Get current url. Lets take an example http:// localhost/root_folder. you just need to write the following code below:- <?php echo $this->Html->url('/', true)?>

How to disable caching completely in Cakephp?

Hello if you want to disable you website's caching complety you just need to write configure code in core.php file ex You will have to look into /app/config/core.php and look for the line Open app/config/core.php file and try to find Con...

Submitting current timestamp in CakePHP

Hi If you want to send curret_timestamp, you can store it by using function below. DboSource::expression('NOW()'); Lets take an example, save your timestamp in a key 'your_datetime_field' $this->data['SomeModel']['your_datetime_f...

How to use another model in current model using cakephp?

Hi If you want a condition where you can load another model inside you model. you can do as I code, see the example below App::import('Model', 'MyModel'); $my_model = new MyModel(); Or you can write $this->SomeModel->MyModel;...
1 12 14 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: