Skip to main content

PHP Tutorial

PHP Date and Time

In this tutorial, we are going to learn about PHP Date and Time. Date and time are part of our everyday lives. PHP also provides this tools to make it work the dates and time easier. These functions allow you to get the date and time from your server where the PHP scripts are running. Then, you can use these functions to format the date and time in some ways. Note: These function it depends on

Facebook Hash Tag and Clickable Link Tutorial

Today is another fresh tutorial for your social media networking site. after this tutorial you will be able to enable #hashtags and clickable link into your media networks as most social media do. I used this script on my Jquery instant messager app. Function for hashtag The script below contain function for clickable link and hashtag, copy and run the code...

How To Change Password Using PHP

Good Day!!! In this tutorial, we are going to learn on How To Change Password Using PHP. In any Web Application, changing password is important feature. Now, let us create a change password using PHP script. database name - change_password old password : change_password Directions: For CSS Codes fieldset { width:500px; border:5px dashed #CCCCCC; margin:0 auto; border-radius:5px; } legend { color

How To Use Function checkdate() Using PHP

Good Day!!! In this tutorial, we are going to learn PHP function, and it's called "checkdate()". The checkdate() function returns true if the specified date is valid, and false otherwise. A date is valid if: month - is between 1 and 12 inclusive day - is within the allowed number of days for the particular month year - is between 1 and 32767 inclusive This function has this form: checkdate(month

How to Create Login Page in PHP and MySQL with Session

How to Create Login Page in PHP and MySQL with Session In my previous tutorial called "How to Create Secure Login Page in PHP/MySQL", I explain on the three ways on how create a login page using PHP/MySQL. This time, I will add more functionality on this tutorial. We will add session so that we will know if the visitor has logged in on our site or not. In PHP, there is a variable called $_SESSION

Server Side Form Validation (Registration Form)

Validating a form using a JavaScript gives convenience to your visitors by avoiding page reload and other features that we discuss on our previous tutorial called Validate Login Page Using JavaScript. But validating a form using JavaScript alone is not safe. One reason is if the JavaScript is not enabled in the web browser. This will bypass all the validation that you have defined in your code. So

How to Create Secure Login Page in PHP/MySQL Part II

This is a continuation of the topic that I have discuss yesterday on How to Create Secure Login Page in PHP/MySQL. Since PDO is too complicated compared with mysqli, I decided to separate this tutorial. So, here we go. login.html Modify the code on our previous tutorial from: to login3.php As you can see above, there are some changes that are far different compared to mysqli. Take this example: In

How to Create Secure Login Page in PHP/MySQL Part I

In our previous tutorial we discuss on how to create a secure registration page using three different approaches. They are: mysql: How to Create Secure Registration Page in PHP/MySQL Part I mysqli: How to Create Secure Registration Page in PHP/MySQL Part II PDO: How to Create Secure Registration Page in PHP/MySQL Part III This time we will create a secure login script based on our previous

How to Create Secure Registration Page in PHP/MySQL Part III

In our last two articles, we discuss on how to create a registration page using mysql and mysqli extension and how to secure it using mysql_real_escape_string or mysqli_real_escape_string. This time we will modify our code to use PDO instead of mysql or mysqli extension. Before we begin, let’s give some few advantages of using PDO in favor of mysqli. Portability – supports 12 different drivers

How to Create Secure Registration Page in PHP/MySQL Part II

mysqli extension works differently compared to mysql extension. The 'i' stands for improved. Which means that it has some features that cannot be found in mysql extension. There are two approach in using mysqli extension. They are Object Oriented style and Procedural style. If you are migrating your old PHP file to mysqli extension, I prefer you use the procedural style. It's very easy to convert