PHP code to set expiration for index page

PHP language is an open-source web scripting language that is included within HTML tags to implement any logic. And Due to the popularity of the PHP language, many web hosting providers have started deploying PHP hosting servers which are called cPanel hosting servers to host a PHP website with MySQL to support the database of a website. But because of some reason if you want to make any changes in your site so you can set the expiration to your site means after some date or year your site shows a custom error on the page then you can add the following code on the index page below the “<?php” code and set the date as per your request.

$exp_date = “2012-04-31”;
$todays_date = date(“Y-m-d”);
$today = strtotime($todays_date);
$expiration_date = strtotime($exp_date);
if ($expiration_date <= $today)
<h1>What you search</h1>
<p>Now Site is Expired </p>
<address>I have set the expiration to my site ,we need to increase expiration date in index page</address>

This is simple which you have to include in your index page to get the thing done at the correct date but you need a quality web host to host your mission-critical web site website and Bodhost UK web hosting service provider is the best from last decade for deploying quality server with an uptime guarantee and online security.

Leave a Comment

Your email address will not be published. Required fields are marked *