Record users posted values with Sessions?
Posted: Tue Feb 06, 2007 8:18 am
Hi
I have the following codes which posts values into a MySQL DB
What I want to do is record the values posted by the user in ($Date) and have them passed to webpage "dd5.php"
which will use the value stored in ($Date) within a query.
Hope you can help
Thanks
Geoff
I have the following codes which posts values into a MySQL DB
Code: Select all
<?
include("conn.php");
$mode=$_GET["mode"];
if($mode=="add") {
$user=$_POST["User"];
$cat=$_POST["cat"];
$subcat=$_POST["subcat"];
$time=$_POST["time"];
$Res=$_POST["Res"];
$Date=$_POST["Missed_Date"];
//Display data
//print_r($_POST); echo "\n</pre>\n";
//print_r($sql); echo "\n</pre>\n";
$sql="insert into Live(user,cat,subcat,time,Date) values('$user','$cat','$subcat','$time','$Date')";
$result=mysql_query($sql,$connection) or die(mysql_error());
//print_r($sql); echo "\n</pre>\n";
header("location: dd5.php");
} elseif($mode=="update") {
$TAB1FIELD2=$_POST["TAB1FIELD2"];
$TAB1FIELD1=$_POST["TAB1FIELD1"];
$sql="update table1 set TAB1FIELD2='$TAB1FIELD2' where TAB1FIELD1='$TAB1FIELD1'";
//echo $sql;
$result=mysql_query($sql,$connection) or die(mysql_error());
//echo $TAB1FIELD2;
header("location: dd5.php");
}
?>What I want to do is record the values posted by the user in ($Date) and have them passed to webpage "dd5.php"
which will use the value stored in ($Date) within a query.
Hope you can help
Thanks
Geoff