maharamDan
IS-IT--Management
Hello I am trying to pass a Date field to a database in a form.
I am trying to make the function hidden however it is not working. This is what I have
if($do == "addevent")
{
echo Please fill out the form :<br>
<form action=admin.php method=post name=myform>
<input type=hidden name=do value=addnews2>
$today = date("F j, Y, g:i a");
<input type=hidden name=date value=$today>
Title:<input type=text name=title> </input>
}
if($do == "addnews2")
{
$query = mysql_query("insert into news values('','$title','$date')");
echo "News Event added successfully<br><br></b>
<a href=admin.php>Back to Admin Area</a><br><br>
";
}
i dont know if I am taking the wrong approach. By the way how do you get the Code text area on tek-tips?
Thanks in advance.
I am trying to make the function hidden however it is not working. This is what I have
if($do == "addevent")
{
echo Please fill out the form :<br>
<form action=admin.php method=post name=myform>
<input type=hidden name=do value=addnews2>
$today = date("F j, Y, g:i a");
<input type=hidden name=date value=$today>
Title:<input type=text name=title> </input>
}
if($do == "addnews2")
{
$query = mysql_query("insert into news values('','$title','$date')");
echo "News Event added successfully<br><br></b>
<a href=admin.php>Back to Admin Area</a><br><br>
";
}
i dont know if I am taking the wrong approach. By the way how do you get the Code text area on tek-tips?
Thanks in advance.