Bala Posted March 30, 2008 Share Posted March 30, 2008 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"; ?> Link to comment https://forums.phpfreaks.com/topic/98654-how-to-give-link-to-variable/ Share on other sites More sharing options...
trq Posted March 30, 2008 Share Posted March 30, 2008 Pardon? Link to comment https://forums.phpfreaks.com/topic/98654-how-to-give-link-to-variable/#findComment-504890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.