Author Archives: Help_adm

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,… Read More »

Category: PHP

PHP File 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”… Read More »

Category: PHP

PHP File Handling

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”);?></body></html> The file may… Read More »

Category: PHP

PHP Include File

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… Read More »

Category: PHP

PHP Date()

The PHP date() function is used to format a time or a date. The PHP Date() Function The PHP date() function formats a timestamp to a more readable date and time. Syntax date(format,timestamp) Parameter Description format Required. Specifies the format of the timestamp timestamp Optional. Specifies a timestamp. Default is the current date and time… Read More »

Category: PHP

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… Read More »

Category: PHP

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… Read More »

Category: PHP

PHP Forms and User Input

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”… Read More »

Category: PHP

PHP Functions

The real power of PHP comes from its functions. In PHP – there are more than 700 built-in functions available. Create a PHP Function A function is a block of code that can be executed whenever we need it. Creating PHP functions: All functions start with the word “function()” Name the function – It should… Read More »

Category: PHP

PHP Looping

Looping statements in PHP are used to execute the same block of code a specified number of times. Looping Very often when you write code, you want the same block of code to run a number of times. You can use looping statements in your code to perform this. In PHP we have the following… Read More »

Category: PHP