I have two input forms for users to enter data, the only difference is one posts the
Date automatically & one lets the user enter the Date manually.
The second form uses sessions to record the Date to use in a query which lets
the user know what they have entered.
Form 1
Code: Select all
include 'conn.php';
Header("Cache-control: private, no-cache");
Header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
Header("Pragma: no-cache");
echo "<table Align ='center' border='1'>";
echo "<tr> <th>Category 1</th> <th>Category 2</th><th>Time</th><th>User</th><th>Add</th>";Form 2
Code: Select all
session_start();
include 'conn.php';
Header("Cache-control: private, no-cache");
Header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
Header("Pragma: no-cache");
echo "<table Align ='center' border='1'>";
echo "<tr> <th>Category 1</th> <th>Category 2</th><th>Time</th><th>User</th><th>Date(yyyy-mm-dd)</th>";The only difference is the session_start();
I'll include the queries for both forms
Form 1 Query
Code: Select all
$quer4=mysql_query("SELECT * From Live inner join category on cat = cat_id inner join subcategory on subcat = subcat_id WHERE Date = Current_date order by User");Code: Select all
$Date = $_SESSION['session_var'];Code: Select all
$quer4=mysql_query("SELECT * From Live inner join category on cat = cat_id inner join subcategory on subcat = subcat_id WHERE Date = '$Date'");Geoff