PHP Tutorial

  • Submitted by: 
    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 (...
  • Submitted by: 
    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...
  • Submitted by: 
    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 $...
  • Submitted by: 
    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 <?php $username = $_POST [ 'username' ] ; $password = $_POST [ 'password' ] ; $conn = new PDO ( 'mysql:...
  • Submitted by: 
    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...
  • Submitted by: 
    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...
  • Submitted by: 
    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...
  • Submitted by: 
    By secured we mean that we need to sanitize the data that is passed to our script in order to secure the registration of new account or user. There are three different types of connectivity in MySQL. They are: mysql = old MySQL function mysqli = improved MySQL function pdo = using prepared statement Mysql_connect is currently not supported in PHP version 5.5.0. So the option left are mysqli and...
  • Submitted by: 
    PHP easter_days() easter_days() function returns the number of days after March 21, on which Easter falls for a specified year. Syntax of this function: easter_days(year,method) year - defines the year to calculate the midnight on Easter from. If the year parameter is omitted, the current year is used. (optional) method - allows you to calculate Easter dates based on other calendars. E.g. it uses...
  • Submitted by: 
    PHP cal_from_jd() The cal_from_jd() function converts the specified Julian day into a date of the specified calendar. Syntax of this function: cal_from_jd(jd,calendar) jd - A number (a Julian day count). (required) calendar - specifies the calendar to use. (required) The following calendar values can be used: CAL_GREGORIAN CAL_JULIAN CAL_JEWISH CAL_FRENCH Example It shows the basic use of this...

Pages