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

How to upload image using simle Jquery and HTML5

Hello Reader's! If you are developing the html5 based ajax image uploader then you can look this jquery as the best and easy to use. Lets see how to upload images 1) include two JS file <script src="jslibs/jquery.js" type="text/javascri...

How to get the colomn name of table using MySql

Hello Reader's, If you have to get the only names of columns of table then see the code below:- You can use following query for MYSQL:- SHOW columns FROM your-table; Below is the example code which shows How to implement above syntax in ph...

How to check if uploading file is in .csv extension using PHP

Hello Reader!, If you are looking for verify the uploading file with the correct extension with .csv only. Then you use the PHP code as below:- $allowed = array('csv'); //you can mentions all the allowed file format you need to accept, like ...

Object Iteration?

In PHP we can iterate any object by using the list of items,for getting list of items we have foreach loop in php. So that there will only the visible properties is being listed. We have loops concept for iterating throughout data list in php....

How to use $_POST in php.?

$_POST is basically used to accumulate form data after submitting an HTML form . $_POST is submit data with method="post". $_POST is also widely used to pass variables. You can see below example of $_POST. <!DOCTYPE html> <html&...

What is difference between session_unset() and session_destroy() in PHP -

The functioning part both the syntax will work the same but by inditing session_unset will clears the $_SESSION variable but will not ravage the variables and it will initialize to this stage: session_unset(); effaces only the variables from s...

How to configure Database in CakePHP

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

How do I get a YouTube video thumbnail from the YouTube API?

Hello Readers! We can use YouTube Data API to retrieve video thumbnails, caption, description, rating, statistics and more. API version 3 requires a key*. Obtain the key and create a videos: list request. Example PHP Code $data = file_ge...

How to remove duplicate values from a multi-dimensional array in PHP?

The array_unique() function removes duplicate values from an array. If two or more array values are the same, the first appearance will be kept and the other will be removed. Example : <?php $a=array("a"=>"red","b"=>"green","c"=&...

How to use ucfirst() function in php ?

What is use of ucfirst() in php ? The ucfirst() function is used for converting the first character of a string to uppercase. Syntax of ucfirst() function: ucfirst(string) string is a parameter that is compulsory to given for convert...

What is superglobals Variables in php. ?

There are many predefined variables in PHP which are "superglobals", that denotes they are always accessible, regardless of scope. and you can access them according to your need from any function. So, there are 5 main superglobal variables i...

How to use of strtoupper() function in php.?

What is use of strtoupper() in php ? The strtoupper() function is used for converting a string to uppercase. Syntax of strtoupper() function:strtoupper(string) string is a compulsory parameter You can see below example of ucfirst() ...

How to use session in php. ?

Firstly let us know what is session ? Session variables hold information about one single user, and provide to all pages information in one application. So, session basicallu store informatiom in a variable and provine in multiple page for a ...

Redirection through htaccess file

.htaccess is the most useful file when we are working with php and apache. The directory level configuration of Apache server software is provided via .htaccess (Hypertext access) files. htaccess files defines mostly all the things like server se...

How to use of join() function in php.?

What is use of join() function.? The join() function returns a string from the elements of an array. The join() function alias of implode() function. Syntax of strtolower() function: join(" ",array) You can see below example of join()...

URL rewriting with PHP using .htaccess

Hello Readers! If you have this URL like : url.com/picture.php?id=51 and you want to make like this : picture.php/Some-text-goes-here/51 . In this case it can be done by using htaccess. Add a file called .htaccess in your root folder...

How to use of strtolower() function in php.?

What is use of strtolower() in php ? The strtolower() function is used for converting a string to lowercase. Syntax of strtolower() function:strtolower(string) string is a compulsory parameter You can see below example of ucfirst() f...

Send email using the GMail SMTP server from a PHP page

Hello Readers! You people can use below code if you are using Gmail SMTP connection. $from = '<fromaddres@gmail.com>'; $to = '<toaddress@yahoo.com>'; $subject = 'Hi!'; $body = "Hi, How are you?"; $headers = array( 'Fr...

What is use of ucwords() function in php.?

Definition of ucwords() function This function is used for converting the first character of each word in a string to uppercase. Syntax of ucwords() function:ucwords(string) string is compulsory paramere You can see below example of...

How to expire a PHP session after 30 minutes?

Setting the session creation time (or an expiry time) when it is registered, and then checking that on each page load could handle that. Example: $_SESSION['example'] = array('foo' => 'bar', 'registered' => time()); if ((time() - $...

How to parse and process HTML in PHP?

Hello Readers! If you want to parse any HTML page then you would you "Simple HTML DOM Parser". How to get HTML elements: Create DOM from URL or file $html = file_get_html('http://www.example.com/'); Find all images foreach($ht...

How to fix Headers already sent error in PHP

Hello Readers! You all got this error many times before and I am sure all PHP programmer at-least once got this error. To solve this error you can solve use solution as per your problem level: Possible Solution 1: You may have left blank...

How to use filter_var() function in php.?

What is use of filter_var() function. ? The filter_var() function filters a variable with the specified filter. Syntax of filter_var() functionfilter_var(var, filtername, options) You can see below example of array_rand() function in php...

How to use array_rand() function php.?

What does array_rand() function in php.? The array_rand() function returns a random key from an array, or it returns an array of random keys if you specify that the function should return more than one key. Syntax of array_rand() function:a...

How to add Captcha with CakePHP

We can add captcha for blocking spams robots accessing our site or application. We can add captcha in our web application and website by using the below code -> <?php App::uses('AppController', 'Controller'); class PagesController exte...

How to use array_keys() function php.?

What does array_keys() function in php.? The array_keys() function returns an array containing the keys. Syntax of array_keys() function: array_keys(array,value,strict) So, there are three main Parameter of array_keys(). These are foll...

Prevent SQL-injection in PHP

User can prevent SQL- injection in php by using given 3 ways. Method1. By Using PHP inbuilt Functions. $name = mysql_real_escape_string($_POST["name"]); mysql_query("INSERT INTO users VALUES($name)"); Method 2. By Using MySqli instead...

Save MySQL query results into a text or CSV file

Hello Readers! MySQL provides an easy mechanism for writing the results of a select statement into a text file on the server. Given a query such as SELECT order_id,product_name,qty FROM orders which returns three columns of data, t...

Importing a csv into mysql via command line

Hello Readers! MySQL have this load data function, where we can insert data to a table from external files like csv, txt etc. The process is quite simple, 1st lets login to mysql via terminal/console. mysql -u root -p Enters usernam...

Upload CSV and Insert into Database Using PHP/MYSQL

Hello Readers ! We can simply upload upload CSV data into database by two simple ways. Step 1 Data Base Connection <?php $db = mysq_connect("Database", "username", "password") or die("Could not connect."); if(!$db) die("n...

How to use array_flip() function php.?

Why use array_flip() function in php.? The array_flip() function mainly used for exchanging all keys with their associated values in an array. Syntax of array_flip() function: array_flip(array) You can take reference form below examp...

String Function In PHP

String function in php To reverse a string strrev- It is used to reverse a string. <?php echo strrev("Hello world!"); // outputs !dlrow olleH ?> To search for a specific text in your string strpos- it return the characte...

How to use array_fill() function php.?

Use of array_fill() function in php. The array_fill() function is basically used for filling an array with values. Syntax of array_fill() function: array_fill(index,number,value) According to above syntax, there are three main Param...

How to use substr() function php ?

Definition of substr() function in php ? The mainly use of The substr() function returns a component of a string. Syntax of substr() function substr(string,start,length) You can see below example the use of substr() function. &l...

How to create custom taxonomy for post type page

Hello readers, today we will discuss "how you can add category for post type page". When a user install the WordPress, user will only get category for "post type post". If user want to add taxonomy or category for "post type page", then u...

How to use define() function php ?

What is define() function ? The define() function basically use for creating a constant. It depends on 3 parameters: 1-name-> this is the name of the constant. 2-value->value of the constant. 3-case_insensitive-> define co...

find and save the records by using cakePHP models

make a controller name Pagescontroller.php and paste the following below code <?php class PagesController extends AppController { public $name = 'Pages'; /* Use Customer model */ public $uses = array('Customer'); ...

How to use compact() Function in php ?

What is compact() Function ? compact() Function is used for creating an array from variables and their values. Syntax compact() Function: compact(variable1,variable1,variable3....) Note:If any strings that does not match variable name...

How to save data in CakePHP

This is a very simple application in cake php for saving the data into database. We can simple make it by making the database and connecting it to cake php. After making the database and tables we can use this code for saving the data input in...

How to handle default error in PHP

We can handle default error in PHP in a very simple way. This can be done by sending an error message with its filename, error line number and a message that describes the error to the browser. Error handling plays an important role whenever we ...

How to use current() function and end() function in php ?

why use current() function: current() returns the value of the current element in an array: Syntax of current() function: current(array) why use end() function: end() returns the value of the last element in an array: Syntax of...

How to use each() function in php ?

What is the work of each() function ? PHP each() function mainly Return the current key and value pair from an array. Syntax of each() function: each(array_name) You can take reference form below example to use of each() function. ...

How to use strrev() function in Php?

What is the strrev() function? strrev() function is uses for reversing a string. strrev() function is also used for reversing a number. In the given below example you can easily understand the use of strrev() function <?php //here c...

How to use list() function in php ?

What is the use of list() function? The list() function is used to assign values to a list of variables in one operation. list() function basically works on numerical arrays. Syntax of list() function:- list(variable1,variable2,variable3...

How to use md5() function in php ?

What is utilization of md5() function ? MD5 stand to Message-Digest Algorithm, and MD5 is widely utilized in security-cognate applications. It Calculates the MD5 hash of str utilizing the RSA Data Security, and returns that hash. So, b...

CakePHP built-in sessions

CakePHP have several In-built sessions configurations. We can use these sessions as the basis or can create a fully custom solution for that. To use defaults inbuilt sessions, we can simply set the defaults key to the name and can override any s...

PHP $_SERVER superglobal variables.

$_SERVER is a PHP super global variable which holds information about headers, paths, and script locations. The example below shows how to use some of the elements in $_SERVER. <?php echo $_SERVER['PHP_SELF']; echo "<br>"; echo ...

Facebook SDK for PHP

Hello Readers , The following code demonstrate how you would accomplish common tasks with the Facebook SDK for PHP. This SDK can be use in facebook login , Retrieve a user's profile , Post a link to a user's feed. window.fbAsyncInit =...

How to use str_replace () function in php ?

What is utilization of str_replace () function ? there are 3 main uses of str_replace () function in php. 1-str_replace() function supersedes some characters with some other characters in a string. 2-str_replace() Supersede all occurren...

How to use strpos() function in php ?

What is the strpos() function ? The strpos() function searches for a concrete text within a string. In other word we can say that strpos() function use for searching position of Text Within a String. If text word match will found, th...
1 9 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: