Why you’ll use session?
From the PHP cookie lesson, you learnt that after web server sends back the file the browser asked for, the transaction completes and both web browser and web server forget about that. Like cookie, session is used to keep track of what a visitor is doing, which pages he is browsing, which items he is selecting in the cart etc. Continue reading PHP Sessions
Why cookies are so important?
When you ask web browser for a web page, the server sends you back that web page and the transaction completes here. After that, when you browse a new page of that site or visit a different website, the browser and the web server both completely forget about the previous transaction. Continue reading PHP Cookies
Commenting is an essential part of any programming language. Comments are plain text inserted within a script to demonstrate the purpose of the codes, author name, written date, modification date etc. It helps to documenting codes properly. Professional and experienced programmers always write comments inside their codes. Continue reading PHP Comments
What is a multidimensional array?
In the PHP Arrays lesson, you’ve learnt that each key/index of an array can contain only one value – a number or a string. Well, instead of a single value, a key may contain another array and then the array is called a multidimensional array. Continue reading PHP Multidimensional Arrays
This is the part 3 of the PHP form. If you didn’t read the previous lessons, please read the previous ones-
1. PHP Forms Part1
2. PHP Forms Part2 Continue reading PHP Forms – Part3
This is the part 2 of the PHP form. If you didn’t read the previous lesson, please read the previous one at first. Continue reading PHP Forms – Part2
Forms are essential parts in web development. Forms are used to communicate between users and the server. It is a way to get information of the user to the server and let the server do something in response to the user’s input. We use form to register in a website, to login, to send feedback, to place order etc. In this lesson, you’ll learn how php handles forms. Continue reading PHP Forms – Part1
The part of a script where a variable is accessible after it is declared is its scope. Not always a variable could be accessed after it’s been declared in the remaining part of the script. The location of declaration determines scope of the variable.
Depending on the existence of function in a script, the scope can be divided into 2 parts-
- Local scope/ function scope: Local or function scope begins from the function declaration to the closing brace at the end of the function.
- Global scope: Other than the local scope, the remaining parts of the function are included in the global scope. Continue reading PHP Variable Scope
Why function is necessary?
In your project, sometimes you need to perform same task multiple times. Therefore, you need to write the same code every time it requires. It makes programming time consuming, boring, and tedious. To make development easier, a programming feature named function comes to rescue in this stage. You can define the set of statements that perform a single task once as a function and call it by its name whenever you need. Continue reading PHP Functions
Up to this point, the php scripts we’ve written in this course are fairly simple and short. But, real world project is different. When you develop a large website, you’ll find that same codes are being used again and again in different scripts. For example, most pages in a website have common header, footer, and navigation menus. In this case, should you copy and paste the same header code in every page? Continue reading PHP File-Inclusion