PHP Session Variables

A PHP session variable is used to store information about, or change settings for a user session. Session variables hold information about one single user, and are available to all pages in one application. PHP Session Variables When you are working with an application, you open it, do some changes and then you close it. [...]

  • Share/Bookmark

Server Side Cookie, PHP Cookies

A cookie is often used to identify a user. What is a Cookie? A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user’s computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, [...]

  • Share/Bookmark

PHP File, Image Upload

With PHP, it is possible to upload files to the server. Create an Upload-File Form To allow users to upload files from a form can be very useful. Look at the following HTML form for uploading files: <html> <body> <form action=”upload_file.php” method=”post” enctype=”multipart/form-data”> <label for=”file”>Filename:</label> <input type=”file” name=”file” id=”file” /> <br /> <input type=”submit” name=”submit” [...]

  • Share/Bookmark

PHP File Handling, File read write

The fopen() function is used to open files in PHP. Opening a File The fopen() function is used to open files in PHP. The first parameter of this function contains the name of the file to be opened and the second parameter specifies in which mode the file should be opened: <html> <body> <?php $file=fopen(“welcome.txt”,”r”); [...]

  • Share/Bookmark

Server Side Includes (SSI), include(), require()

Server Side Includes (SSI) are used to create functions, headers, footers, or elements that will be reused on multiple pages. Server Side Includes You can insert the content of a file into a PHP file before the server executes it, with the include() or require() function. The two functions are identical in every way, except [...]

  • Share/Bookmark

PHP Date Function

date The PHP date() function is used to format a time or a date.date – Format a local time/date Description string date ( string format [, int timestamp]) Returns a string formatted according to the given format string using the given integer timestamp or the current local time if no timestamp is given. In otherwords, timestamp is [...]

  • Share/Bookmark

PHP $_POST

The $_POST variable is used to collect values from a form with method=”post”. The $_POST Variable The $_POST variable is an array of variable names and values sent by the HTTP POST method. The $_POST variable is used to collect values from a form with method=”post”. Information sent from a form with the POST method [...]

  • Share/Bookmark

PHP $_GET

The $_GET variable is used to collect values from a form with method=”get”. The $_GET Variable The $_GET variable is an array of variable names and values sent by the HTTP GET method. The $_GET variable is used to collect values from a form with method=”get”. Information sent from a form with the GET method [...]

  • Share/Bookmark

PHP Form

The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. PHP Form Handling The most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts. Form example: <html> <body> <form action=”welcome.php” [...]

  • Share/Bookmark

PHP Functions

The real power of PHP comes from its functions. In PHP – there are more than 700 built-in functions available. PHP Functions In this tutorial we will show you how to create your own functions. Create a PHP Function A function is a block of code that can be executed whenever we need it. Creating [...]

  • Share/Bookmark