Category «PHP»

session in php

In this tutorial you will learn how to store certain data on the server on a temporary basis using PHP session. What is a Session Although you can store data using cookies but it has some security issues. Since cookies are stored on user’s computer it is possible for an attacker to easily modify a …

Sending Emails using PHP

PHP must be configured correctly in the php.ini file with the details of how your system sends email. Open php.ini file available in /etc/ directory and find the section headed [mail function]. Windows users should ensure that two directives are supplied. The first is called SMTP that defines your email server address. The second is …

file handling in php

This chapter will explain following functions related to files − Opening a file Reading a file Writing a file Closing a file Opening and Closing Files The PHP fopen() function is used to open a file. It requires two arguments stating first the file name and then mode in which to operate. Files modes can …

function in php

PHP functions are similar to other programming languages. A function is a piece of code which takes one more input in the form of parameter and does some processing and returns a value. You already have seen many functions like fopen() and fread() etc. They are built-in functions but PHP gives you option to create …

Array in php

What is PHP Arrays Arrays are complex variables that allow us to store more than one value or a group of values under a single variable name. Let’s suppose you want to store colors in your PHP script. An array is a data structure that stores one or more similar type of values in a …

control structures in php

Control Structures Control Structures are loops, like for, and conditionals, such as if. Most of these will be familiar to the javascript programmer, and this page is basically a list. The following exist in php: if and else These are exactly the same as javascript and other languages. if ($a==$b) { print “The same”; } …