The following are the program how can i give pass variable to href
<?php
// search.php
$dd=$_POST[days];
$dd = str_pad($dd, 2, '0', 1); // If it is less than 2 characters long, add a 0 on the left side
$mm=$_POST[month];
$mm = str_pad($mm, 2, '0', 1); // If it is less than 2 characters long, add a 0 on the left side
$yy=$_POST[year];
$j=$dd . "-" . $mm . "-" . $yy . ".html";
echo "<a href=<?$def_dir/$j?>clickhere</a>";
$month = strtolower(date('M', strtotime("$yy$mm$dd 12:00:00"))); // A lot going on here
// strtolower makes the results all lowercase to match your 'mar' for march
// date('M', ...) returns the 3-letter form of month
// strtotime() is returning the unix timestamp for date() for the submitted date, at 12 noon.
$def_dir="/var/www/html/backup/$month";
?>