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

CakePHP Controller Basic

A Controller in MVC like cakePHP is basically used to manage the logic around a single model. LIke for example if you are working on User model than  you have to have a controller for it name UsersController.php for managing the model. ...

How to do AJAX cross domain calls ?

I was facing issue to post data by a form to foreign domain. I am aware of "AJAX cross-domain policy". So we just can't call "http://yahoo.com" over ajax http request and display the results on my page. So after researchin...

PHP CURL: How to Crawl multiples pages in a loop

How to crawl many pages at one page hit: I was facing issues for getting the data from multiple urls by loop. The problem is that in the first loop I was getting the data by function Cron, but when second page was called by Cron function then ...

how to upload a image in php?

PHP script is used in a HTML form to allow users for uploading a file from a folder or server. Whenever user do so initially the file is in the temporary directory after it will relocated into the target destination. The uploaded file could be an...

How to register new user using cakephp

For storing new user information in database, first we have to  create a new table in database which contain user name,email,password fields. The logic of the controller is written below. In below code we have create a function registrati...

How to pass array argument to bash file from php

I was facing this issue of passing the array from php to the bash file. To pass array to bash file write the following lines of code. Php Code: $array= $countries_array; // Countries array from database shell_exec('sh get_countries.sh '....

Function of login and logout in cakephp

Implementing code of login and logout in cakephp by using auth component in this process appController needs to be modified so that it uses Cake’s Auth component will work at the time of login and logout. This is where we tell the Auth comp...

How to convert shell script to php code?

My objective for posting this blog is to tell how do we convert shell scripting code to php. In some cases we need to use php code instead of executing shell script. Therefore I am writing the blog which may help someone to understand how do we c...

CRUD operations in cakephp

Let us start with the simple CRUD (Create, Read, Update and Delete) Application. Before we begin let me split the processes we are going to do this this blog into the following steps: Creating the Database Create models Create controlle...

Difference between include() and require() in php?

In order to include the content of another PHP page in the current PHP page we can use two methods provided by PHP which are: include() require() With the above two methods we can make HEADER, FOOTER, FUNCTIONS when user is working o...

__autoload function in php

A function in PHP which starts with a double underscore”__” are called magic functions in PHP. __autoload functions is used to add very large number of include statements automatically without the programmer. For instance: inc...

Magic Methods in PHP

PHP does not provide any specific definitions of the magic methods or functions. It is the programmer who actually writes the code to the functions that defines which states what the magic functions will do. But, magic functions are not directly ...

What are the benefits of Cake PHP frameworks

1.CakePhp is basically a framework which is based on MVC pattern i.e(model view controller). 2.Cakephp have built in validation. 3.Cakephp have fast and flexible php syntax with helpers. 4.Cakephp is very friendly because developer done ...

How to Create Database in cake php

CakePHP database configuration details are in a file that is located at app/Config/database.php. This database file user can edit the file in the notepad or sublime and can edit the feilds by which it will be connected to the database.Filling al...

login form in cakephp

Its really easy to create a login form by using cake php, for creating a form a user have to mention its type,action or url for pointing the form to the login() action to the controller, user would supply array like this. And for further fields t...

How to make multilanguage website in Codeigniter

Hello Reader's if you are looking to desing the multilaunge website then codeigniter offers you to do this with very easy steps. First learn what is multilanguage website.   A multilanguage website is which can run in any langauge ...

How to make dynamic session routing in PHP

Hello Reader's, if you are making the website in which you want to redirect the user on the same page after the user login. Then you can learn it from this blog.   For example if a user hit 'my profile' without making the l...

How to make Parent Child tree in PHP

Hello Reader's if your making the parent child relationship then this blog is very helpful to you. Here we are making parent child tree by using the Iteration functions. The output of this will a tree which showing the childs on branches and ...

How get only selected keys of an array using PHP

Hello Reader's, If you having a multidimensional array from which you only want a single key values column then this blog is helpful to you. Let consider a array with full of key values:-  $exArray=array( array(...

How to convert SOAP response to PHP Array?

Converting SOAP response to Array in php.   Dealing with a SOAP client response for a flight booking application or any other, This is how we get response from SOAP below: <S:Envelope xmlns:S="http://schemas.xmlsoap.org/so...

Validating Captcha code using php

Captcha verification includes: should be a combination of alphanumeric characters. should be case-sensitive fresh captcha is to be displayed whenever a webpage is refreshed. should be refreshed when user enters incorrect value. &...

Jquery Ajax exapmle in php

Here in this blog i have shown  a simple example how to use AJAX to send and retrieve data from a PHP page and then populate the result from a PHP page in a HTML element. The example here shows when I select a country a request is send to...

How to sort column by clicking on column header iin PHP

Below code will gives us a table on which when we  first time click the headers of column, it display data in ascending order.  if we click the header second time than it display values in descending  order.   <?php...

How to fetch data from database in PHP

For fetching data from database  in php, first we have to create a connection from database by using following code.   <?php $servername = "localhost"; $username = "root"; $password = "pass"; $database = "demo"; //this wi...

jquery validation method

jquery validation is a pattern of checking of input desired code user need a standard library of validation method and include the file into the same folder. it is a process of ensuring that computer input is clean and correct by using the rules ...

Difference between PHP4 and PHP5

PHP is a server side scripting language which is used to create dynamic web pages. PHP5 ia an updated version of PHP. PHP4 is no longer developed. There are some additional features in PHP5 due to which it is used widely. Some features a...

A simple registration and login form and connectivity through database in php

For Javascript validation please refer this link:  http://findnerd.com/account/#url=/list/view/Simple-Javascript-form-validation/15856/     FOR REGISTERING: Here is the code for registering the user and saving data in data. ...

Polymorphism

Polymorphism in php Implementing the polymorphism principle can be done in either of two ways, i.e., either choosing abstract classes or interfaces.   /* Program to demonstrate a polymorphism principle in php */ <?php c...

Captcha Code in php

Captcha stands for “ Completely Automated Public Turing test to tell Computers and Humans Apart”. A captcha is a small program which is used to develop a software program that can create and grade challenges most humans can pass but n...

How to insert values into database in php.

Inserting data to a database would be possible by using SQL statements, specifically the INSERT command. Data can be entered  into the database using insert query into the function, here is simple line of code that will create a database usi...

how does foreach loop exactaly work in php

The foreach function in php will be used for a easy way to iterate over the loop and it is only used in array and objects or It will give you an error when you try to use it on a variable with different data type. Syntax: foreach(array_e...

Session in php

Session is used in php to store information with the help of session variable. By creating session we can use that information across multiple pages. When we create an application we write the code, do some changes and then we close it our s...

Insert data into database from form in PHP

Below is a form which contain id field, name field, phone number filed, gender radio button and we are sending these data  by using post method. <form name="user_registration" method="post" > Name: <input type="text" name...

Different type of Session function in php

session_start(); It Start new session or resume existing session or the current one based on the session identifier passed via any request like $_get and $_post. When a session start php will call the open and read the session handlers.User can ...

Explanation of php_uname

php_uname function is used in php for getting information about the operating system ,host name, release name, version information and machine type.This method is used in php for returning a description of the current operating system in which yo...

PHP and AJAX

AJAX is a topic which comes under PHP AJAX Stands for Asynchronous JavaScript and XML. AJAX is used to update segment of web pages, without refreshing the whole page. By using AJAX we can create dynamic web pages easily and very fa...

Where to use isset() or empty()?

isset() and empty() are the function of PHP which are used to check whether the variable contains some value or not. The major difference between them is:: isset() is used when we want to just check whether the variable is set or not. It re...

Fetching Data from database using php

To fetch a data from database by using simple PHP code,  firstly create a connection to the database by using simple query and create a login form using HTML code for entering values through user. on clickinng submit button, This form will b...

Difference between isset(), empty() and is_null() functions

In PHP we have three different functions which can be used to test the value of a variable. They are isset(), empty() and is_null(). All these functions return a boolean value. But in case if these functions are not used in correct way they can c...

Creating database using php.

Database in php can be Created by using the four argumnets:- Servername,Username,Password and dbname. This will give the information about the server like a using 'localhost' username as 'root' and password should be of users ...

Code to fetch form data to database

Here is a simple program code to enter the form data to the database using php. HTML Code: <!DOCTYPE html> <html> <head> <title>Form To Db</title> <style type="text/css"> .container{width: 80%;...

How To Upload File in PHP

Below we first creating a html form, which contain a field for uploading a file and a submit button for submiting form. <html> <body> <form action="file_upload.php" method="post" enctype="multipart/form-data"> Sele...

Simple code of php for making tree using asterisk

Simple code of php for making tree using asterisk It is easy to make tree using php in less no. of line of code. Here are few line of code that will help you to get desired output by using for loop with three variable i,j and k or this can be ...

FORM HANDLING IN PHP

Below is a  simple html form which have two input type fields and submit button :- <html> <body> <form action="form_post.php" method="post"> Name: <input type="text" name="name"><br> E-mail: <input...

$_GET and $_POST methods in php

Explanation of GET and POST methods in php GET and POST are treated as $_GET and $_POST in php. These are superglobals, which means that they are always accessible. $_Get: This is used as an array of variables and passed to the current scrip...

Sorting function in php

Php sorting function of an array:  sort()  -This will sort an arrays in ascending order.  rsort() -This will sort arrays in descending order  asort() -This function will sort associative arrays in ascending order, ac...

Pattern Desigining in PHP

Hello Reader! All of us must have designed a code to print pyramid or some other pattern of asterisk using C, C++. Here is a simple program to print the different asterisk(stars) patterns in PHP. A pattern of stars is a way of arranging these in ...

PHP Global Variables

PHP contains many predefined variables from these predefined variables many are superglobals, It means that we can access all these variables from any function,file or class without having any problem. Below are some PHP superglobal variables:...

How to read a file in php ?

Hi Reader's, Welcome to FindNerd, today we are going to discuss how to to read a file in php ? If you want to read a file in php the you should use readfile() function. This function reads a file and writes it to the output buffer. It...

What is process to pass arguments to PHP ?

Hi Reader's,   Welcome to FindNerd, today we are going to discuss how to pass arguments to PHP ?   If you want pass some arguments into function and elements of an array.   Then Your arguments will be receive by your funct...
1 2 4 14
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: