Hi all, I'm having a problem.
I need to use this code, to detect whether or not its the next day since a user last submitted data to the website i made..
here's the code:
<?php $thismonth = date("m"); if ($thismonth=="01") // list January's dates { echo "<ul id=\"dateslist\">";
echo "<li>Wed, 7th January</li>";
echo "<li>Wed, 14th January</li>";
echo "<li>Wed, 21st January</li>";
echo "<li>Wed, 28th January</li>";
echo "</ul>";
} elseif ($thismonth=="02") // list February's dates {
echo "<ul id=\"dateslist\">";
echo "<li>Wed, 4th February</li>";
echo "<li>Wed, 11th February</li>";
echo "<li>Wed, 18th February</li>";
echo "<li>Wed, 25th February</li>";
echo "</ul>";
}
?>
<?php
$conn = "localhost";
$user = "myuser";
$pass = "mypass";
$dbname = "metaldetect02";
$tbl2 = "users0002";
$con = mysql_connect($conn,$user,$pass);
if (!$con)
{
die('Could not connect to database: "' . $dbname . '" because ' . mysql_error());
}
mysql_select_db($dbname, $con);
$sql="INSERT INTO $tbl2 (item, firstname, lastname)
VALUES
('".$_POST[requireditem]."','".$_POST['requiredfirstname']."','".$_POST['requiredlastname']."')";
echo "Thanks for submitting your item, ".$_POST['requiredfirstname'].", ".$_POST['requiredlastname']."!<br>";
echo "Returning you to the previous page...";
echo "<script>setTimeout('document.location = \"./\";', 2000);</script>";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
?>
ANY help is GREATLY appreciated! 🙂