Featured
-
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Best 5 Lightweight PHP Frameworks for REST APIs Development
Are you ready to develop the Rest AP
by ankur.kumar -
PHP: Full-Stack Framework vs Micro Framework
A web framework can be described as a software fra
by ankit.bhatia -
How to get facebook profile picture by Facebook App
If you would like to get your profile picture in f
by vivek.rastogi -
Creating RESTful API in cakephp
This tutorial will help you to learn how to create
by pushpendra.rawat
Tags
Email Validation
Hello Reader's today we will discuss about "Email validation in Php".
The below code tells that how to check your email is valid or not. For this we use regular expression for validate email.
<?php
if(isset($_POST['submit']))
{
$email...
Php server variables
Hello Readers,
Today we will discuss about "Php server variables".
$_SERVER is one of the tremendous world-wide specifics within PHP. It includes information regarding headers, server, web host in addition to and many others. Its content has...
How to Disable Wordpress Updates
If you would like to disable word-press updates please follow the below process:
Open your current selected Theme folder.
Open under this folder function.php and
put the below code at the end of this file
//To Disable Theme Updates # WP V...
How to set session time out for fix time period in PHP
Hello Reader's,
If you want to set session time out for fix time period in PHP use the below code.
$page = $_SERVER['PHP_SELF'];
$sec = "1";
header("Refresh: $sec; url=$page");
session_start();
$now = time();
if(!isset($_SESS...
Sorting the elements of array
In this tutorial we will learn how to sort the elements of an array on the basis of the keys or values as per
the requirement.We will discuss the following sorting functions with example:
sort()
rsort()
asort()
ksort()
arsort()
krsort...
How to install Laravel5 using composer
This tutorial will help a user to install Laravel5 a framework in php with the help of a composer.
The basic requirements to install Laravel5 are as mentioned below:
PHP >= 5.4
Mcrypt PHP Extension
OpenSSL PHP Extension
Mbstring P...
How to create RSS (Rich Site Summary) in Cakephp framework
This tutorial help us in creating RSS Feed in cakephp framework. For more on RSS Feed see the link below:
"http://findnerd.com/account#url=/list/publish/What-is-RSS-Rich-Site-Summary-/2965/"
Let use take a table users in the database.
...
How to use theme in yii2
First download a sample theme from http://yii.themefactory.net/ and extract it in to yii2basic/themes folder.
Now open /config/web.php and add the below code
'view' => [
'theme' => [
'pathMap' => ['@app/views' => 'th...
Check file exists or not
Hello Reader's today we discuss about "Check file exists or not in Php".
HTML code :
<!DOCTYPE html>
<html>
<body>
<?php echo $message; ?>
<form enctype="multipart/form-data" method="POST">
<input type=...
Multiple file upload in Php
Hello Reader's today we discuss about "Multiple file upload using Php".
Make sure that the shape employs method="post" The shape also desires the subsequent feature: enctype="multipart/form-data". This specifies which in turn content-type to u...
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...
FIle Upload Code
Make sure that the shape employs method="post"
The shape also desires the subsequent feature: enctype="multipart/form-data". This specifies which in turn content-type to utilize as soon as posting the form.
Without worrying about demands abov...
WooCommerce- how to redirect product add to cart?
Hello Readers!
If you want to redirect users after adding a specific product to their cart. Below is the example, just pasted this code into into your themes functions.php file
<?php
add_filter( 'woocommerce_add_to_cart_redirect',...
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...
How To Change Total Count Of Items Displayed Per Page in WordPress
Hello readers!
In my previous blog I have explained you how you can change number of products displayed per row in WordPress.
So here I will guide you how you can change total count of items displayed per page in WordPress.
Lets take an exam...
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...
10 Useful Plugins in CakePhp
CakePHP allows us to set up a combination of models,views ,controllers and release them as a packaged application called Plugins which can be used in the CakePHP applications.
Some of the useful Plugins in CakePhp web application are as foll...
Write a file Using Php
Write a file Using Php
In PHP, there are many functions available which is used to write a file.
The functions are...
fwrite(), fputs(), file_put_contents
Syntax:
fputs-
fputs($file,$string,$length);
fwrite-
fwrite($file,$st...
Implement Pagination Using Cakephp
This tutorial will help you to learn how to implement pagination using cakephp framework
Requisite:
Create a database
Insert some data in the table
Controller say UsersController to write the logic.
Model for the Users table
View...
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
Delete a file Using Php
Delete a file Using Php
In PHP, we can use unlink() function to delete a file from given folder/path.
unlink() returns boolean value. It returns TRUE on success and FALSE on failure.
Syntax:
unlink($targetFilename);
Arg:
1. $t...
Connecting to database other than joomla database
Joomla provides two methods to access database:
1. The below method is used to access the Joomla database.
JFactory->getDBO() (Internal database access)
2. This method is used to access the database other than joomla database i...
changing the joomla site favicon
Changing favicon icon in joomla is very simple and easy.
A favicon is a small size image display on browser tab when you open your joomla site.It always have extension .ico file.
Below are the steps of changing favicon icon:-
1 ...
How to change number of products displayed per row in WordPress
WooCommerce- CHANGING THE NUMBER OF PRODUCTS DISPLAYED PER ROW
Hello Readers !
There is no rocket science used for changing the number of products displayed per row below I am providing simple and short method.
Here, I am using loop_shop_c...
Creating RESTful API in cakephp
This tutorial will help you to learn how to create rest api in cakephp. For this we need to follow the
following steps:
Step1: Create a database and a table say "users"
Step2: Now we will create the Users Model, Veiw and Controller...
Create a Custom Post Type in WordPress manually
Creating a Custom Post Type Manually
You can create any custom post type in wordpress any name which you want like- If you are creating a movie review site then you can create a custom post type with the name 'movie'.
Wordpress have some d...
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 implement C.R.U.D operations using Ajax and Simple PHP
This tutorial will help user to learn, how to implement create, retrieve, update, and delete operations
without refreshing the web page using Ajax and simple php.
This is the html file named view.php
Ajax | CRUD
...
WooCommerce- How to change Add to cart Text in WordPress
Hello readers!
Changing Add to Cart Text is not a big issue, below I am providing the method to change this text to your cart.
So, to change add to cart text you can use single_add_to_cart_text filter, after adding the filter connect it to your...
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...
Create a file Using Php
Create a file Using Php
In PHP,we can use the fopen() function to create a file.
If we use fopen() on a file, it will create file(if that file does not exist) by given named.
Syntax:
fopen("testfile.txt", "Mode");
Both arguments are ...
PHP Sorting Array
Sorting Arrays
PHP offers a host of functions for sorting arrays.
An initial a means the function sorts by value but maintains the key/value pairs association.
An initial k means the function sorts by key but maintains the key/value pa...
Set custom shipping method in Magento
In magento you can add custom shipping in your website by writing some custom code , lets first go through how shipping work in magento ,
When magento looks for available shipping methods, Magento first collects all available shipping methods...
Creating model form field in joomla
For creating custom form fields please use the following steps:
Step 1:Add all the custom fields to the following XML file
components/com_library/views/book/default.xml
<fields name="request" addfieldpath="administrator/components/com_...
Using magento api to add all products to root category
To use soap api to add a products of categories into root category , first we need to create a magento user with the permission to access the api.
Following code will be use to set products to root category
$soap = new SoapClient('http://m...
Magento- Retrieve the attribute label using config.xml file
To show the custom attribute label and value in a magento cart we do the following
suppose attribute_code is myvar
it's ID/VALUE is 7 and LABEL = Myvar
create config.xml of module with the following code
<global>
<sale...
Attach invoice PDF with invoice email in magento
Sometime we need to send a invoice pdf in a invoice mail in magento, so here I am explaining how to add invoice pdf in invoice mail.
1) Override the app/code/core/Mage/Core/Model/Email/Template/Mailer.php file in your module
2) Add one prot...
How to Speed Up Your Magento site
In magento you can improve website speed by doing some small tricks, Below are the 5 Different techniques to boost magento site, Just do the following steps to achieve it:
1) Enable Flat Categories and Products Options: Go to the Magento Admin...
Most useful plugins for magento
Here are 5 most useful extension for magento
1. OneStepCheckout
one step checkout make checkout process easy. In magento defualt checkout user waste more time to fill information in many steps but one step checkcut extension make it easy
htt...
Adding Authors Images to Your Blog in WordPress
Hello reader's!
Toady we discuss about "Adding Authors images to your blog".
WordPress is integrated with Gravatar, allows you to show every post author's avatar in their posts. It makes your business look more personal than being as a f...
PHP.ini configuration for handling large file upload in PHP
PHP provides a friendly environment in case of file uploads but if one wants to upload files greater then 2 Mega Bytes then the default installation of PHP fails.
But, we can increase the limit when ever necessary.
This Blog will help you conf...
Joomla- adding sortable columns to a table in a component
Adding sortable columns to Users Table in Admin section
<th class="left"-->
<!--?php echo JHtml::_('grid.sort', 'Candidate Number', 'candidate_number', $listDirn, $listOrder); ?-->
</th>
Adding sortable columns to...
Magento restrict user registration to specific email domains
In Magento we can restrict user registration to specific email domains, therefore for restricting specific email domains on registration page we have to add a validation
for example we can add like this-
function validateEmailDomain($email...
How to add categories to top navigation bar in Magento?
To add category in navigation bar go in app/design/frontend/rwd/default/template/page/html and open file topmenu.phtml
now find -
<?php if($_menu): ?>
<nav id="nav">
<ol class="nav-primary">
<?...
How to Create SEF Urls in joomla Component
In Joomla, for creating SEF URLs in joomla component you need to make your router file which has very important role in each and every component to allow SEF URLs.
Let's assume that your component url is like this:-
http://www.mysite.com/inde...
Creating Photo album gallery in wordpress
Hello reader's!
Today we discuss about "Creating Photo album gallery to your WordPress."
Recently, we had a person who wanted us to create a photo gallery combine with albums. He wanted that if any user click on the album then he able to...
Top ten extensions in joomla
Below are the Top Ten Joomla Extensions
1. JCE (Joomla Content Editor)
Joomla Content Editor (JCE) is probably one of the most popular Joomla extensions. Specially for those who might not be technically inclined or have issues using the...