I’m trying to retrieve an expiration date from a database and compare it to todays date. If the expiration date hasn’t arrived yet, I want to execute the below HTML program, if not I want to display a message. I don’t know how to incorporate the HTML. ?
[code=php]<?php
mysql_connect(localhost,root,””);
mysql_select_db(expiredb) or die( “Unable to select database”);
if(!empty($_POST[“submit”]))
{
$noticedate = $_POST[‘noticedate’];
$expiredate = $_POST[‘expiredate’];
$query=”SELECT noticedate,expiredate FROM entrydata”;
$result=mysql_query($query);
if(mysql_num_rows($result))
{
$todays_date = date(“Y-m-d”);
$today = strtotime($todays_date);
$expiration_date = strtotime($expiredate);
if ($expiration_date > $today) echo “Time left”;
else echo “Time elapsed”;
?>
[code=html]<HTML><HEAD>
</head>
<frameset rows=”25%,75%” frameborder=”0″ border=”0″ framespacing=”0″>
<frame src=”hologo.html” name=”Logo” marginwidth=”0″ marginheight=”0″ noresize scrolling=”no”>
<frameset cols=”170,*” frameborder=”0″ border=”0″ framespacing=”0″>
<frame src=”honav.html” name=”Navigation” noresize scrolling=”auto” marginwidth=”0″ marginheight=”0″>
<frame src=”hocalendar.html” name=”Main” noresize scrolling=”auto” marginwidth=”0″ marginheight=”0″>
</frameset>
<noframes>
<em>Sorry, your browser does not support frames.</em>
To visit our unframed site <a href=”hoinfo.html”>click here</a>
</noframes>
</frameset>
</html>