Friday 31 July 2015

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 approach to do this:

1: For boolean value, use:

if ($var) {}
or
if (!$var) {}
 
2: Null or false value:

How to compare PHP Variables and Arrays with null or empty values
Read the full Blog How to compare PHP Variables and Arrays with null or empty values at FindNerd's Forum.

FindNerd is an effective C, Java, Android, Html, iOS, JavaScript, PHP Developer forum, to instantly resolve your various language queries.

Apart from this, If you have any html language issue, you can post at HTML questions and answeres and get instantly resolved it from highly experienced FindNerd community members.  

Thursday 30 July 2015

HTML Interview Questions and Answers

Hello, This tutorial, will provide you HTML questions and answers. The content here will help people to get through with their interviews for software industry. If you want to get into an IT industry as a font end developer the recruiters expect the knowledge of HTML. There are some common questions asked by every interviewer, so here we have collected few questions and related answers based on HTML for freshers and experienced which will definitely helps you.

What is HTML?

HTML stands for Hyper Text Markup Language used to describe web documents (web pages). Markup language or HTML is the set of and described by markup or HTML tags, where each HTML tags describes different document content. HTML Interview Questions and Answers

Read the full set of HTML Interview Questions and Answers , visit at FindNerd's Website.

FindNerd is an effective technology forum, so here you can post & look for various programming queries along with their solutions including android, C, Java, JavaScript, HTML questions and answers .

Apart from this, If you have any PHP language query, you can post at PHP questions and answers and get instantly resolved it from highly experienced FindNerd community members  

Wednesday 29 July 2015

In magento layouts are used to display contents of each page using layout.xml which we will found in app/design/frontend//default/layout. Each module have it's own layout file e.g. customer module has customer.xml and catalog module have catalog.xml etc. If we check these files , we will see different tags which contains different blocks. These layout files contains structural block and content block which decides which contain to be displayed on page. Sometime we need to update those block with our custom blocks so here I am explaining how we can do that:-

- For full code, Read the complete Blog: Customizing Magento Layouts with XML
  Customizing Magento Layouts with XML
FindNerd is an effective c, Java, Android, Html, iOS, PHP Developer forum, to instantly resolve your various language queries.

Apart from this, If you have any html language issue, you can post at HTML help forum and get instantly resolved it from highly experienced FindNerd community members.

Tuesday 28 July 2015

How to make custom attribute in Html5 ?

Hi all, You can make your own custom attribute using data-. It allows possessive exchanged information between HTML and its DOM representation. It can work with javascript also, every browser will let you fetch and modify data- attributes using the getAttribute and setAttribute methods.

Example with css -  

css :-
 
section [data-index='123'] {
color:red;
width:200px;
}
 
 
 
How to make custom attribute in Html5 ?
-For full set of codes /steps, visit the complete Blog: How to make custom attribute in Html5 ?

FindNerd is the right place to resolve HTML problems. Here you can post Html Help Forum.
Apart from this, If you have any PHP language query, you can post at PHP questions and answers and get instantly resolved it from highly experienced FindNerd community members.

Monday 27 July 2015

Turning Magento Cache Off

Magento uses two level cache backend . Two level cache means it stores cache records in two backend. By default, Magento stores it's cache entries in the file system, magento cache files are present in var/cache. At the time of development it is recommended to turn off the cache to see the change you have made without waiting for cache.

For Full set of steps, Visit complete Blog: Turning Magento Cache Off
  Turning Magento Cache Off  
FindNerd is an effective technology forum, so here you can post & look for various programming queries along with their solutions including android, C, java, PHP questions and answers .

Apart from this, If you have any HTML language query, you can post at HTML questions and answers and get instantly resolved it from highly experienced FindNerd community members.

Friday 24 July 2015

Assigning New Magento Theme

To assign a new theme to magento follow these steps

1) Go to admin > System > Configuration

2) select 'Design' tab on the left menu bar under General Tab.

 Assigning New Magento Theme
For step by step procedure to assigning new Magento theme, Visit full Blog: Assigning New Magento Theme
 
FindNerd is the right place to resolve PHP language problems. Here you can post PHP Questions and Answers. If you need PHP language, visit to FindNerd’sPHP Blog.

Thursday 23 July 2015

In this example, I have a user's table & I want to get the user who have maximum and minimum amount. For that I used the following code.

How to fetch maximum and minimum value of a column in laravel
 
 
$price = DB::table('users')->max('amount');
$price = DB::table('users')->min('amount');
 
- For complete Blog, Visit FindNerd Forum Link: How to fetch maximum and minimum value of a column in laravel .

FindNerd is the right place to resolve PHP language problems. Here you can post PHP Questions and Answers.

If you need PHP language, visit to FindNerd’sPHP Blog.

Wednesday 22 July 2015

How to Hash Password in Laravel

Laravel provide Bcrypt hashing for store a secure password by using keyword Bcrypt we can hash our password




How to Hash Password in Laravel  


$password = bcrypt('secret');
 
We can use this also  

$password = Hash::make('secret');

- See the complete Blog at: How to Hash Password in Laravel  

FindNerd is a excellent technical community where you can post and look for PHP Questions and Answers . If you need more Blogs related to PHP language then visit to our PHP Blogs.

Tuesday 21 July 2015

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 this case.  

For complete information, Visit full Blog: How to Upload Two Separate Files in PHP


  How to Upload Two Separate Files in PHP  


FindNerd community is a right place where you can post and look for PHP Questions and Answers .
If you need more Blogs related to PHP language then visit to our PHP Blogs.

Monday 20 July 2015

Woocommerce- Remove Orderby Dropdown for Products

Hello again, In this tutorial I will guide you to remove or edit the orderby dropdown for products, so if you have any such requirement follow the below code. If you want completely remove the drop down and ordering options, add below single line code to your functions.php file:

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );
 
Here in above code, 10 is priority of the function, which is default priority, you can change it according to you. For complete set of Steps/ Codes, Visit full Blog: Woocommerce- Remove Orderby Dropdown for Products

  Woocommerce- Remove Orderby Dropdown for Products

FindNerd: Being an effective C, C#, Java , PHP Developer forum, here you can also post & look for various programming queries along with their solutions including android, java, PHP questions and answers etc.

Friday 17 July 2015

How to install Yii2 via Composer on Linux

In this blog, I am explain step by procedure to install YII2 via composer on linux. Yii 2 helps Web Programmer to make complex softwares and deliver them on or before deadlines.

  How to install Yii2 via Composer on Linux

 Before installing yii2 we need to install composer for install composer run these commands


curl -s http://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
 
 
Now for install yii first locate to your web root folder cd /var/www For Complete set of steps/ Commands, Visit full Blog: How to install Yii2 via Composer on Linux

FindNerd is the right place to resolve PHP language problems. Here you can post PHP Questions and Answers.If you need more this type of blog on PHP language, Find at FindNerd’sPHP Blogs.

Thursday 16 July 2015

How to Remove Product Tabs

Hi,
If you want to remove all tabs or any particular tab for example description and reviews, then use the below code in the functions.php:

add_filter( 'woocommerce_product_tabs', 'FindNerd_remove_product_items', 58 );
function findnerd_remove_product_items( $items ) {
unset( $items['description'] ); // To remove description item
unset( $items['reviews'] ); //To remove reviews item
 
 
How to Remove Product Tabs

 
 
For complete set of steps/ code, Visit full Blog: How to Remove Product Tabs
 
FindNerd: Being an effective C, C#, Java , PHP forum here you can also post & look for various programming queries along with their solutions including android, java, PHP questions and answers etc.

Wednesday 15 July 2015

InterNationalization in CakePHP

Hello Readers ,

Today we will learn about the concept of ” InterNationalization in CakePHP ” .
“InterNationalization” simply means if you are making an application and you wants to make that applications to reach a larger audience to cater for multiple languages.

InterNationalization in CakePHP

To do this below are the steps-
 
Create a new CakePHP project:
 
Download the latest version from http://cakephp.org/.

For full set of steps/ Code, Visit at: InterNationalization in CakePHP

FindNerd: Being an effective C, C#, Java , PHP forum here you can also post & look for various programming queries along with their solutions including android, java, PHP questions and answers etc.

Tuesday 14 July 2015

How to Disable Comments Section on Wordpress Page

You need to follow below step to remove comment section in WP Page.
1) Make admin login on Wordpress.

2) You can view "Pages" menu on left panel. On mouse over you can view "All Pages" & "Add New" options. Please click at "All Pages

Disable comments, Wordpress

In this Blog, I am Explaining step by step procedure to Disable Comments Section on Wordpress Page. For the full set of steps Visit my full Blog.

- See full Blog at: How to Disable Comments Section on Wordpress Page
FindNerd is the right place to resolve PHP language problems. Here you can post PHP Questions and Answers.

If you have any query on PHP language, Post it at FindNerd’sPHP Developer Forum.

Monday 13 July 2015

How to Copy Files in PHP

How to open and read PHP files have been discussed in previous blog:
How to open and read files with PHP

Now,we will discuss about copying a php file.
In php,we can Copy files from “source” to “destination”.
Function used :

    copy(used in PHP 4, PHP 5)

It takes two parameters as input:
1. Destination path
2. Source Path

Syntax:

$file_open = fopen("http://127.0.0.1/", "r");
$file_open = fopen("http://127.0.0.1/", "r");
$file_open = fopen("http://127.0.0.1/", "r");
$file_open = fopen("http://127.0.0.1/", "r");
$file_open = fopen("http://127.0.0.1/", "r");
$file_open = fopen("http://127.0.0.1/", "r");
$file_open = fopen("http://127.0.0.1/", "r");
$file_open = fopen("http://127.0.0.1/", "r");
      copy (string $source, string $destination);
 
- See full Blog at: How to Copy Files in PHP.

FindNerd: Being an effective C, C#, Java ,  PHP Developer forum, here you can also post & look for various programming queries along with their solutions including android, java, PHP questions and answers etc.

Friday 10 July 2015

Paginator Helper in CakePHP

Cake php provide inbuilt pagination we can use this by using Paginator Helper.

To use pagination first we need to use Paginator Component public $components = array('Paginator','Auth'); now add the below code in your controller here i am using pagination for users table
 
 
public function index() {
 $this->User->recursive = 0;
        $this->set('users', $this->Paginator->paginate());
    }
 
 
- See full Blog at: Paginator Helper in CakePHP
 
FindNerd is the right place to resolve PHP language problems. Here you can post PHP Questions and Answers.

If you have any query on PHP language, Post it at FindNerd’sPHP Developer Forum.

Thursday 9 July 2015

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 oops. By implementing inheritance we can inherit(or get) all properties and methods of one class to another class.The class who inherit feature of another class known as child class.The class which is being inherited is know as parent class.
Body of Single level Inheritance.

    class grandParent
    {
    //Body of your class
    }
    class parent extends grandParent
    {
    //Body Of your class
    }
 
Read the full Blog at: Inheritance in PHP .

If you have any query related to PHP language then goto to our PHP Developer Forum.

FindNerd community is a right place where you can post and look for PHP Questions and Answers .

Wednesday 8 July 2015

Add Logo in Theme Customize Option in Wordpress

Hello reader's today we discuss about "Add logo in theme customize option" in wordpress. Open your function.php and paste the below code :-


/**
* Add logo in theme customize option
*/
add_action( 'customize_register', 'themename_customize_register' );
function themename_customize_register($wp_customize) {
$wp_customize->add_section( 'ignite_custom_logo', array(
'title' => 'Logo',
'description' => 'Display a custom logo?',
'priority' => 25,
) );
$wp_customize->add_setting( 'custom_logo', array(
'default' =>; '',
) );
 
 
- See full Blog at: Add Logo in Theme Customize Option in Wordpress


FindNerd is the right place to resolve PHP language problems. Here you can post PHP Questions and Answers.
If you have any query on PHP language, Post it at FindNerd's - PHP Developer Forum.
Hello reader's today we discuss about "Add logo in theme customize option" in wordpress. Open your function.php and paste the below code :-
  1. /**
  2. * Add logo in theme customize option
  3. */
  4. add_action( 'customize_register', 'themename_customize_register' );
  5. function themename_customize_register($wp_customize) {
  6. $wp_customize->add_section( 'ignite_custom_logo', array(
  7. 'title' => 'Logo',
  8. 'description' => 'Display a custom logo?',
  9. 'priority' => 25,
  10. ) );
  11. $wp_customize->add_setting( 'custom_logo', array(
  12. 'default' =>; '',
  13. ) );
- See more at: http://findnerd.com/list/view/Add-logo-in-theme-customize-option-in-wordpress/3364/#sthash.QJ5eQfOw.dpuf

Tuesday 7 July 2015

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 our system, Its called Session tracking.

Now the question is why we need to track the session, answer is very simple .HTTP state less protocol, When you refresh you page, Its lost every information, So this is the reason we need session handling.


To handle session in php we need to a global variable $_SESSION and session_start()


- Read full more at: Using Database Session Handling in Code PHP

If you have any query related to PHP language then goto to our PHP Developer Forum. FindNerd community is a right place where you can post and look for PHP Programming Questions and Answers .

Monday 6 July 2015

How to Calculate Distance Between Two location by PHP Code

If you would like to calculate air distance between two location without any API or mysql query. You can use below code to get distance between two location.

  1. $distance_one_latitude = 30.364267;
  2. $distance_two_latitude = 30.324860;
  3. $distance_one_longitude = 78.087412;
  4. $distance_two_longitude = 78.052046;


- Read full Blog at:  How to Calculate Distance Between Two Location by PHP Code

If you have any query related to PHP language then login to our PHP Developer Forum. FindNerd community is a right place where you can post and look for PHP Programming Questions and Answers .

Friday 3 July 2015

How to Apply Style to a Cakephp Debug Console

We have cakephp debug on or off option in core.php file, if debug is on then all errors and query will show at the bottom of the page. we can give it some different style or UI so that it will be more readable. we can apply css like below code
  1. .cake-sql-log {
  2. position:fixed;
  3. top:99%;
  4. z-index:10;
  5. width:100%;
  6. background-color:black;
  7. color:white;
  8. border-collapse:collapse;
Read full blog at: How to Apply Style to a Cakephp Debug Console


If you have any query related to PHP language then ask at our PHP Developer Forum, which is an excellent place to post and look for PHP Programming Questions and Answers
 

Thursday 2 July 2015

How to Reorder Product Tabs

If you want to reorder product tabs, you can do this according to you wish as you want, just add the below code to your function.php.


<?php
add_filter( 'woocommerce_product_tabs', 'FindNerd_woo_reorder_tabs', 90 );
function FindNerd_woo_reorder_tabs( $woo_tabs ) {
$woo_tabs['reviews']['priority'] = 10; // Reviews first
 
 
 
- Read Full Blog at: How to Reorder Product Tabs


If you have any query related to PHP language then ask at our PHP Developer Forum, which is a right place where you can post and look for PHP Programming Questions and Answers

Wednesday 1 July 2015

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. Sanitizing data = Remove any illegal character from the data...


Read the full Blog with complete information at: PHP filters to Sanitize and Validate Data

If you have any query related to PHP language then FindNerd community is a right place where you can post and look for PHP Programming Questions and Answers