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
How to use htaccess to restrict directory access by IP address?
To restrict directory access by IP address you need to follow the steps given below:
Create a file or open a file .htaccess(started with a dot) inside the directory that you want to protect.
Add the code given below to the file:
Orde...
How to change default template in Joomla?
Changing default template for front-end:
Login to the back-end of Joomla site.
Click Extensions -> Template Manager.
Default template for site is marked with a star(yellow in color) which is protostar.
Select the template you want to s...
How to get rid of locks in Joomla?
In Joomla, Lock means that the item is currently opened by any user for editing. The lock automatically removes when user clicks on "Save", "Save and Close" and "Cancel" button. If user not click on "Save" or "Close" buttons and instead click on ...
How to make Email component in XAMPP
Hello Reader!
On using the PHP from your local host on XAMPP you can do several other things also
and we will learn how to configure mail from localhost using its sendmail package ,
The mail function is called sendmail, It's inbuild package ...
Featured articles in Joomla
Featured Articles are those articles which are displayed on the front-page in Joomla. Whenever you create an article as featured they are by default displayed on the front-page. To create an article as featured follow the steps given below:
...
How to insert, Update & remove data using JDatabase
Inserting data using JDatabase:
JDatabaseQuery class includes methods such as insert(), columns() and values() to insert data.
For example:
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db...
How to assign an article to a menu in Joomla?
To assign a article to a menu you need to follow the following steps:
Login to back-end of Joomla site.
Click Menus->[name of your menu] -> Add new menu item. For ex: Menus -> Main Menu -> Add new menu item.
You will see a form...
How to create articles in Joomla?
Articles is the piece of information that includes text, images, links etc., which you want to display on to your site. To create articles you need to follow the following steps:
Login to back-end of the Joomla site.
Click Content ->Arti...
How to Select data from one or more tables and retrieve it in a variety of different forms?
To select data from one or more tables in Joomla:
Ex:
// Getting db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// give the name of field instead of column name that you want to d...
How to get User details in Joomla?
To view the details of user in Joomla we use the following method:
JFactory::getUser();
It returns reference to the user object. The return object is of type JUser. It contains users information such as, id, name, email etc.
Ex:
$us...
How to retrieve data from single and multiple tables in Joomla?
Retrieving data from Single table:
// Getting db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__tablename')); // tab...
How to give external URL to a menu in Joomla?
To give external URL to a menu in Joomla you need to follow the following steps:
Login to back-end of Joomla site.
Click to Menus -> [name of your menu] for example, Menus -> Main Menu
Now press the new button on the top left corner ...
How to connect to an external database in Joomla?
External Database means database other than Joomla Database. You can connect database other that Joomla by following method:
JDatabase->getInstance()
For example:
$external_db = array(); //prevent problems
$external_db['driver'] = 'my...
Which are the supported database and storage connectors in Joomla?
Available Database and storage connectors in Joomla are given below:
MySQL: Available in Joomla versions 1.5, 2.5, 3.0. It's a Joomla DB
Microsoft SQL Server: Available in 2.5, 3.0 versions which is a Joomla DB.
Microsoft SQL Azure: Avai...
What is the difference between Parked Domain, Sub Domain & Add-On Domain?
Subdomain:
A subdomain is a site with totally different content but with no new domain name. It's a directory inside public_html folder in your server. For example: mydomain.com/mydirectory or mydirectory.mydomain.com. This facility is free of c...
How to remove index.php from Codeigniter
Hello Reader! If you are new to working on Codeigniter Framework for PHP then you are very likely to encounter with the problem of index.php in url. Now we will see how to get resolve this error and then after you do not need to include index.php...
make your number to 2 decimal places round in PHP
Let's consider the example below using the function sprintf
$result = 3.146124;
echo sprintf("%.3f",$result);
output:
3.140
Alternatively, with printf:
$result_rounded = sprintf('%0.2f', $result);
Output
3.14
How to get the last key of an given array in PHP
Hello Reader!
Getting last the key index of any array PHP can be done on several ways as follows:-
Lets consider an example array $MyArray
$MyArray = array(
'one' => firstelement,
'two' => secondelement,
'three' =>...
How to get the file format/extension of file in PHP
Getting the file format or extension of any file can be done by various ways, In PHP you can use the one way as written bellow
$FileName = explode('.', $_FILES['photo']['name']);
$FileFormat = end($FileName);
Using the explode yo...
Combining two strings together in PHP
Combining of multiple using to add up one single can be achieve by various ways
In PHP you can either join then by using (.) Concatenate Operator or by using String Interpolation:
We'll do both of way here
Let's consider two stings
$o...
How to generate QR Code using PHP?
You can create your QR Code using the PHP QR Code library. Download the QR Code library and include in your script file.
Example:-
<?php
include "phpqrcode/qrlib.php";
// create your QR Code with new text and display it
QRcode::png...
How to Generate QR Code?
What is QR Code?
A QR code (Quick Response Code) is a type of barcode that is readable by dedicated QR readers, iPhone, Android and smartphones. The barcode using encoded information like numbers, letters, and Kanji characters. QR Code is an 2D ...
What are magic functions?
PHP have some magic methods that you can use in OOP (Object Oriented Programming). All the magic functions must be identified with twice underscores (__) prefix and they work as interceptors that will run when certain required conditions are met....
How to copy a website from local host to a remote host
Below are few ways by which we can copy a website from local to remote server.
Upload all files using FTP such as filezilla or winscp just select all files from directory and upload it to remote host HTML directory for domain. Also another wa...
How to resolve "Unable to connect to the database" error?
There are few most common ways to fix database connection errors which are as given below.
1 Need to check Database details such as username or password which is exist in configuration.php is either incorrect or has been changed.
2 Compare ...
Different Menu item type in joomla
Menu item type in Joomla defines type of page which will display when user select any menu item. As menu item is link to that particular page and menu item type determines the type of that page. For eg if user select category list so it list all...
Unable to install any extension in joomla
There are several cause due to which we are unable to install any extensions some are given below. some of the common issues are "Warning! failed to move file" and "JFolder::create: Could not create directory" So following are the list of the st...
How to use Flash on Banners in Joomla?
To use flash on Joomla you need to follow the following steps:
Login to back-end of joomla site.
Select Component -> Banners.
You will Banner Manager page. Click on new button on the top left side.
You will see a form to add banners. E...
How to use the JTable Class
Table is an abstract class which models the database and need to put constructor which declares the table name and primary key and also override some methods. It is used for creating,updating, reading and deleting of records in database. As this...
Methods to recover or reset admin password in Joomla 2.5 and higher versions.
In joomla you can change the password from back-end normally. For this you need to login to your back-end and go to Users -> User Manager. A list of users appear. Click the name of the admin and an edit form will appear. Now from here you can ...
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...
What are categories, content items, Sections & Articles in Joomla?
Sections and Categories:
Sections and Categories in Joomla are used to organise or manage the articles. A section have one more categories and a category have one or more articles assigned to it. An Article in Joomla is associated with exactly...
How to move an article to archive status?
To move an article to archive status you need to follow the steps given below:
Login the backend of the Joomla Site(Joomla administrator)
Select Content (given in the menu at the top of the page) -> Article Manager. You will see a page w...
How to assign a module to specific pages in Joomla 3.1
Joomla assign positions to module i.e., position tells where you want to place th module in the page. You can assign the position by following steps:
Login to backend of your website(Joomla administrator).
Go to Extensions --> Module Man...
How to hide a live site from others while developing?
Joomla provides you the facility to hide the live site from others while your are developing the site. For this you required to follow the steps given below:
Login to the back-end of Joomla Site(Joomla administrator).
Select Site -> Glob...
How to customise the information shown in the Login Form module?
To customize the information of Login Form module according to your requirement you need to follow the following steps:
Login to the backend of Joomla site(administrator).
Select Extensions -> Module Manager. A list module appears.
Sear...
Use multiple tables join in YII custom query
In yii we can write our custom or row query for complex queries here is an example of custom query with multiple table joins
$data = Yii::app()->db->createCommand()
->select('column1.column2,column3.name')
->from('table')
->...
How to enable CURD operation in YII
In yii we can create our basic code for 'CREATE',,'UPDATE','READ','DELETE' operations. for enable this functionality we need to enable curd.
For enable curd go to your main.php file and find keyword 'gii' and you will see like this
/* 'mod...
How to configure database setting in YII php framework
In 'config/main.php' file we have database setting in yii for set or change database open main.php file and search 'db' you will see something like this
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=mydb',
...
Form Validation Using PHP
What is form Validation ?
This is the process to validate web form according to our data format, when the user try to submit wrong data in the field, server will not submit wrong data because we have restricted(validate) the all field ...
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 change default cakephp paginator sorting label?
The default code of cakephp paginator sorting label.
<?php echo $this->Paginator->sort('first_name'); ?>
We can change it as follows:
echo $this->Paginator->sort('first_name', 'First Name');
Explanation:
Here we c...
What are the minimum Joomla requirements?
Joomla have many versions. So before installing Joomla your system required to fulfill the following requirements which varies according to the version you are using:
Joomla Version
Software
Databases
Web Servers
3.x
PHP *Recomme...
How to connect database using PDO in php
PDO does not account for database specific syntax. It can allow for the process of switching databases and platforms. PDO can simply switch the connection string in many instances.
PDO supports the following database:
PDO_FIREBIRD ( Firebird/In...
How to change the Login Form module settings?
Joomla provides a Login Form module used for login/logout purpose in Joomla. Once user logged in it gives a logout button and also provides user access additional resources on your site. Login Form will appear in the position which you have assig...
How to change the Favicon?
Joomla contains Favicon inside templates/your_templatename/ directory. To change this icon you need to replace that file with the one you want instead of it. Process of changing favicon is described below:
First, you need to create a 16x16 p...
email address validation in php
By using 'eregi' we can validate our email address.For validate email we use a pattern and match our email address with this pattern
function isValidEmail($email_address)
{
$emailpattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0...
What is a Template in Joomla?
Template is one of the type of Joomla Extensions. It represents your site look i.e., layout of your site. Templates are of two types: one is Front-end Templates and other is Back-end Templates.
Template Types
Front-end Templates:
Front-e...
How to create category attribute ?
Magento provides a way to add product attribute from admin but sometime we need to add category attribute in our category settings. So here I am going to tell you the way we need to create category attribute programmatically.E.g. I am creating on...
How to find a module position on any given page in Joomla?
Joomla works on Positions. It basically divides the page into different parts that is known as positions. Module are assigned to those positions. To display the module positions you required to follow the following points:
Login to the backe...