To know what is a cookie and about the optional parameters for the cookie see click the link below.
http://findnerd.com/list/view/What-is-a-cookie/13459/
Here we will see how to create a cookie and modify the cookie and how the cookie exp...
Hello Friends,
File uploading is very basic component of web-development. If you are new in Codelgniter and want to code for file uploading please follow the below code:
//Configure set the path where the files uploaded will be copied. Make...
To get the table and field information of a table in MySQL using PHP we will follow the steps given below:
Make a connection.
Select a database.
Find the number of fields using the mysql_num_fields().
Then we will print the type, name, le...
In python, tuples is just like a list but little differ form list, To say correctly tuples is a sequence of immutable Python objects and it can not be change just like a list also tuples use parentheses.
Creating a tuple is as simple you have to...
on('click', function() use less memory then .click(function() and it works on dynamically added elements.If we are using on('click', function() then we can remove this handler by using off('click', function(). The main advantage of on click is th...
Hello Friends,
Pagination is the basic component of listing pages. If you are new in Codelgniter and want to use paging in your listing pages. Please follow the below code for the same:
1) Open your listing controller where you want to show l...
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use opendir() function in php ?
The opendir() function is used to open a directory handle.
The opendir() function always returns a directory handle resource on succe...
<-- Chapter 23: SQL Wildcards
Chapter 24
SQL Aliases
SQL Aliases are used to rename a particular table name or column name in a temporary manner. In a SQL statement , any table or column name can be temporary change.
SQL Syntax fo...
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use is_dir() function in php ?
The is_dir() function is used for checking a specified file in a directory and returns TRUE if the directory exists.
syntax of is_dir...
In some cases we need to add or remove an attribute to an element and we have only his parent ID then we can get the child element by using parent ID. For example I have a UL element which have many <li> and each <li> has an anchor ta...
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use fstat() function in php ?
The fstat() function is used for returning information about an open file.
syntax of fstat() function
fstat(file)
file is a requir...
There are two PHP functions count() and sizeof() which can be used to count the number of elements of an array. Both functions can also be used to count the number of elements of multi-dimensional array also. The explanation of these functions ar...
Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use readdir() function in php ?
The readdir() function is used for returning the name of the next entry in a directory.
This function returns the filename on succes...
Hello Friends,
If you are looking to set flash messages in Codelgniter framework. Please follow the below code for the same:
1) Open your controller function and put the below code to define flash message
$this->session->set_flashdat...
Hello Friends,
If you are looking to define logout functionality in Codelgniter. First we will unset the defined session variables then we will destroy the function. After this we will redirect the page in your desirable location. Please follo...
In python loop control statements means(CSM) that CSM is change execution from its normal sequence and When execution leaves a scope, all automatic objects that were created in that scope are destroyed.
python support three statements of loop co...
In python to create for loop refers to executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
Use the below example to create for loop:
test = raw_input("what is for loop ")
for letter i...
Defect Logging And Defect Tracking:- In the software testing field both terms Defect Logging and Defect Tracking are very important. For more details please see below:-
Defect Logging:-Defect Logging is a technique, which is used to determin...
It is a small file in a text format and it contains no executable code and has all the information in plain text. Browser stores the cookie file in the users work machine. These cookies are sent to the server with each request that follow a set o...
Python does not support a character type treated as strings of length 1, thus also consider a substring.
To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring. For example
#!/usr/b...
tabnanny module helps us to check Python source files for
With the help of tabnanny module we can checks Python source files for unclear indentation. If a tabs and spaces are mixed by a file in such a way that throws off indentation, no matte...
The profile module is a standard Python profiler. And with the help of profile module we can run the profiler from the command line. For example you can see the below code.
#!/usr/bin/python
vara = 17
varb = 400
sum = vara + varb
print "va...
The pdb module stand for Python debugger. It is used on the bdb debugger framework.
And we can run the debugger from the command line and go to the next line and help to get a list of available commands.For example you can see below code.
$p...
Dis module is the Python disassembler. It is used to converts byte codes to a format that is slightly more appropriate for human consumption and python function.
And we can run the disassembler from the command line. It can use to compiles the g...
Python Variables that are defined inside a function body have a local scope, and those defined outside have a global scope and variable.
That indicate local variables can be accessed only inside the function in which they are declared, whereas g...
In return statement return exits a function, optionally passing back an expression to the caller and value. A return statement with no arguments is as same as return None and function. For example you can see below example for return statement.
...
Hello Reader in this blog you will see how to get result of two arrays in a single array using PHP
Array one name information
Array
(
[0] => Array
(
[0] => 125479
...
Hello Reader's if you have the current date and you want to get some past dates or future dates then here you can see it. PHP offers you to use inbuilt function strtotime.
Lets see how you can adjust the dates with this.
Here you will get the ...
Hello Reader's If you have a string with words occurs more than two times then here you can see how to remove them as a single.
Lets see the string below full of random words and 34 is repeating.
$mystring = '2,34,two,findnerd,logic,66,34,5...
Hi if you have a long text file full of line and you need to search some text in it then you can use this function. This function will accept the words from user then search from a text file and return the lines which have matching words.
<...
To delete records of more than one table we can use joins. Joins are used to combine two table. Here, we will use join to delete the records from more than one table.
Syntax:
DELETE T1, T2 FROM T1 INNER JOIN T2 ON T1.key = T2.key WHERE con...
To rename a database in MySQL you need to follow the steps given below:
Dump the schema using Mysqldump
Restore the dump schema to other schema
Drop the old schema(if required)
For Example:
Suppose we have a database emp which needed...
Hello Reader's if you need to cast the objects in PHP then this blog is helpful to you .
Here below I created a function which will cast the object and relocate the object to location as you define
function cast($destination, $sourceObject)...
Hello reader's I have created a conversion format that can convert array in tree structure.
In this code i use while loop but you can either use the recursive also. So here is the function as below:-
function treeze( &$a, $parent_key, $ch...
In MySQL, to handle a result set inside a procedure we use cursors. Cursors are:
Read only
Non-scrollable
Asensitive
Cursors can be used in stored procedure, stored functions and triggers.
Syntax:
Declare cursor:
Declare curs...
Hello Friends
This is a good practice if we include only essential files on every page like I have implemented dropbox on a particular abc page and this idle to include this file only on abc page or where it is require. Please look at the belo...
Hello Friends,
If you are looking to implement SMTP email via gmail account. Please follow the below code:
$mailObj = new PHPmailObjer;
$mailObj->SMTPDebug = 3; //SMTP debugging on.
$mailObj->isSMTP(); ...
Hello Readers,
Default user class in joomla has not provided salted MD5 to hash the password. So In joomla 3.2.1 The bind function of the User class now provides the facility to calls JUserHelper::hashPassword($array['password']) to encrypt t...
Hello readers, today I guide you "to import jQuery in Joomla"
This can be a rule which we all utilize to guarantee that only 1 content involving jQuery can be imported. The idea merely tests to see in the event jQuery is already been imported...
The native session drivers not require any additional setup. It does not use cookies to store data. Native session drivers use native php mechanism for store session. It use 'NativeSessionStorage.php' for store data.
By using Native session...
Hi Readers
Recently when I was working in Laravel, I came across an issue. It was regarding the selection of a particular layout as per the logged-in user. I have to show a particular layout according to the role of the user logged-in. When I ...
In laravel 5.2 we can bind a model to a route.This model binding is called Implicit model binding
Route::get('/web/users/{user}', function(Post $user) {
return $post;
});
in this case if i use request users/1 it will will inject the...
Hello Readers,
last() is the jquery method which is used to select or returns the last element of the selected elements or the matched elements in jquery.
Syntax :
$(selector).last()
In the above syntax there is no parameter inside ...
Hello Readers,
innerWidth() is the jquery method and it is same as innerHeight() method in jquery but the difference is that it is used to get or computed the innerWidth of the jquery matched element, this method including padding of the eleme...
Personality development plays an important role for the growth of an individual as well as for the growth of an organization. If the resources working within a firm have good personality...
To handle large file upload in PHP web application, we need to configure PHP.ini file. if you want to upload files greater then 2 Mega Bytes then the default installation of PHP fails. But, we can increase the limit according to the file size wit...
Hello Readers ,
Below are the simple steps to follow to show the google map.
Add the Goggle API
<!DOCTYPE html>
<html>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<body>
<h1>M...
Hello Guys,
What is XAMPP ?
As XAMPP is a user friendly application and very easy to install. It contain components like Apache web server application, Mysql Database , PHP and Perl programming support.
In my previous blog post, We d...
Many times the webpage footer comes up due to no or less content on the webpage. We can resolve that with the help of Bootstrap CSS this is also known as Sticky Footer. This CSS will make sure that the footer will remain at the bottom of the scre...