HMV.co.in

September 23, 2008

Number of days between now and a day in the future

Filed under: php — Tags: , , — Harsha M V @ 10:55 pm

Description

This will calculate and show how many days there are from the current date to a date in the future that you define.

The code


<?php

// Change this to the day in the future

$day 10;

// Change this to the month in the future

$month 12;

// Change this to the year in the future

$year 2003;

// You do not need to edit below this line

// $days is the number of days between now and the date in the future

$days = (int)((mktime (0,0,0,$month,$day,$year) - time(void))/86400);

echo "There are $days days until $day/$month/$year";

?>

Page redirect

Filed under: php — Tags: , , , — Harsha M V @ 10:51 pm

Description

If you want a PHP redirect script that redirects visitors from a page to a specific URL then this is it. It sends the user from one web page to a different web page address. It is a good alternative to using the meta tag http-equiv option.

The code


<?php

/**

 * Place in a blank PHP page

 */

// Change to the URL you want to redirect to

$URL="http://www.example.com";

header ("Location: $URL");

?> 

Blog at WordPress.com.