A Null variable is a variable that doesn’t have a value. A variable is considered Null in following scenarios:

When creating a variable in PHP, you don’t always need to assign a value to it. You can just define the variable without a value by skipping its assignment part as shown in the below example:

<?php$username;

As you can see in the above example, we have defined a variable called $username but we have intentionally skipped assigning a value to it. When you have created a variable in this way, then that variable is considered a NULL variable.

Another situation where a variable can become NULL is that…

Kindly check https://community.geekgong.com/d/5-null-variables-in-php/ for the complete article.

Thanks.

--

--

The following PHP snippet can be used to display a countdown timer on a web page.

Start by creating a new PHP page in your code editor. In the beginning of the code we need to start a PHP session by calling the session_start() function:

<?php
session_start();

Then set the default time zone for your region. I am in Sri Lanka so I set it to Asia/Colombo:

date_default_timezone_set('Asia/Colombo');

Next add below code block:

if(!isset($_SESSION['expire'])){
$_SESSION['expire'] = time()+3600;
}

In that part we were checking to see…

Kindly check https://community.geekgong.com/d/6-creating-a-countdown-timer-in-php/ for the complete article.

Thanks.

--

--

In this post I am going to show you how to create a form that allows uploading multiple files at once. There is nothing much complex about this. As you’ll see the trick is in how we configure the file upload field.

Here is the basic HTML form:

In the above markup, pay your attention to the code that defines the form. There are few things that you should take a note:

  • Form’s method is set to POST which is recommended.
  • enctype attribute value is set to…

Kindly check https://community.geekgong.com/d/8-multiple-file-uploads-with-html-php/ for the complete article.

Thanks.

--

--