Author: admin
-
PHP Error Handling
Handling Errors Sometimes your application will not run as it supposed to do, resulting in an error. There are a number of reasons that may cause errors, for example: These types of errors are known as runtime errors, because they occur at the time the script runs. They are distinct from syntax errors that need…
-
PHP Filters
Validating and Sanitizing Data with Filters Sanitizing and validating user input is one of the most common tasks in a web application. To make this task easier PHP provides native filter extension that you can use to sanitize or validate data such as e-mail addresses, URLs, IP addresses, etc. To validate data using filter extension…
-
PHP Form Validation
Sanitizing and Validating Form Data As you have seen in the previous tutorial, the process of capturing and displaying the submitted form data is quite simple. In this tutorial you will learn how to implement a simple contact form on your website that allows the user to send their comment and feedback through email. We…
-
PHP Form Handling
Creating a Simple Contact Form In this tutorial we are going to create a simple HMTL contact form that allows users to enter their comment and feedback then displays it to the browser using PHP. Open up your favorite code editor and create a new PHP file. Now type the following code and save this…
-
PHP Send Emails
The PHP mail() Function Sending email messages are very common for a web application, for example, sending welcome email when a user create an account on your website, sending newsletters to your registered users, or getting user feedback or comment through website’s contact form, and so on. You can use the PHP built-in mail() function for creating and sending…
-
PHP Sessions
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 cookie content to insert potentially harmful data in your application that might break your application. Also every time the browser requests…
-
PHP Cookies
What is a Cookie A cookie is a small text file that lets you store a small amount of data (nearly 4KB) on the user’s computer. They are typically used to keeping track of information such as username that the site can retrieve to personalize the page when user visit the website next time. Tip: Each…
-
PHP File Download
Downloading Files with PHP Normally, you don’t necessarily need to use any server side scripting language like PHP to download images, zip files, pdf documents, exe files, etc. If such kind of file is stored in a public accessible folder, you can just create a hyperlink pointing to that file, and whenever a user click…
-
PHP File Upload
Uploading Files with PHP In this tutorial we will learn how to upload files on remote server using a Simple HTML form and PHP. You can upload any kind of file like images, videos, ZIP files, Microsoft Office documents, PDFs, as well as executables files and a wide range of other file types. Step 1:…
-
PHP Parsing Directories
Working with Directories in PHP In the previous chapter you’ve learned how to work with files in PHP. Similarly, PHP also allows you to work with directories on the file system, for example, you can open a directory and read its contents, create or delete a directory, list all files in the directory, and so…