hmm, I tried it like you suggested, still no date value sent to the database.
Heres the code I'm using now
<?php
$cur_date = date("F dS Y"
function user_logout() {
setcookie('user_name','',(time()+2592000),'/','',0);
setcookie('id_hash','',(time()+2592000),'/','',0);
}
include($DOCUMENT_ROOT.'/include/database.php3');
include($DOCUMENT_ROOT.'/include/user.php3');
if (user_isloggedin()) {
user_logout();
$user_name='';
}
if ($submit) {
user_register($user_name,$password1,$password2,$email,$real_name);
}
if ($feedback) {
echo '<FONT COLOR="RED"><H2>'.$feedback.'</H2></FONT>';
}
echo '<H3>Register With BAA Private Community</H3>
<P>
Carefully fill in this info and a confirmation email will be sent to you.
<P>
Please write down your log in information so that you do not have trouble accessing the Private Community at a later date <P>
<FORM ACTION="'. $PHP_SELF .'" METHOD="POST">
<B>Real Name:</B><BR>
<INPUT TYPE="TEXT" NAME="real_name" VALUE="'. $real_name .'" SIZE="20" MAXLENGTH="35">
<P>
<B>User Name:</B><BR>
<INPUT TYPE="TEXT" NAME="user_name" VALUE="'. $user_name .'" SIZE="10" MAXLENGTH="15">
<P>
<B>Password:</B><BR>
<INPUT TYPE="password" NAME="password1" VALUE="" SIZE="10" MAXLENGTH="15">
<P>
<B>Password (again):</B><BR>
<INPUT TYPE="password" NAME="password2" VALUE="" SIZE="10" MAXLENGTH="15">
<P>
<B>Email (Required - Must be accurate to confirm):</B><BR>
<INPUT TYPE="TEXT" NAME="email" VALUE="'. $email .'" SIZE="20" MAXLENGTH="35">
<P>
<Input type=hidden name=Joined
value="'.$cur_date.'">
<P>
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Send My Confirmation">
</FORM>';
?>
I've also tried it like you said, still didnt work
<Input type=hidden name=Joined
value="<?php echo $cur_date?>">
Does the date show on the form ?
view the html source and see if the date is shown.
if it does then the $Joined var is being reset in
your php insert script or the format of $Joined
is incorrect for Mysql.
can you show your SQL insert query?
Try printing the $Joined var just before you
submit the query.
If your date field is of type DATE , you may need
to reformat the $Joined var before inserting
it into the database.
I know that mysql DATE field takes 'yyyy-mm-dd'
format.
Yes you are right, I viewed source and <Input type=hidden name=Joined value="August 25th 2000">
And you are also correct that the Joined Field is of Date and is in this format 0000-00-00
I guess this explains why no info is being sent to db. Geeze, I thought this would something simple to do but its turning out to be quite the opposite.
So Basically I'm sending this to the database which it wont accept so it needs to be reformatted?
date("F dS Y" to the 0000-00-00 format, but how?
Then to make things more ridiculous, I have a page
on which I will use to display the name and JOINED date. I wanted it in the August 25th 2000 not the 2000-08-25 format lol Does that mean I have to change it again there in that script? Man I'm confused
Hmmm, I did as you said, but I still don't get a date value in the database upon form submission :-(
<?php
function user_logout() {
setcookie('user_name','',(time()+2592000),'/','',0);
setcookie('id_hash','',(time()+2592000),'/','',0);
}
include($DOCUMENT_ROOT.'/include/database.php3');
include($DOCUMENT_ROOT.'/include/user.php3');
if (user_isloggedin()) {
user_logout();
$user_name='';
}
if ($submit) {
user_register($user_name,$password1,$password2,$email,$real_name);
}
if ($feedback) {
echo '<FONT COLOR="RED"><H2>'.$feedback.'</H2></FONT>';
}
echo '<H3>Register With BAA Private Community</H3>
<P>
Carefully fill in this info and a confirmation email will be sent to you.
<P>
Please write down your log in information so that you do not have trouble accessing the Private Community at a later date <P>
<FORM ACTION="'. $PHP_SELF .'" METHOD="POST">
<B>Real Name:</B><BR>
<INPUT TYPE="TEXT" NAME="real_name" VALUE="'. $real_name .'" SIZE="20" MAXLENGTH="35">
<P>
<B>User Name:</B><BR>
<INPUT TYPE="TEXT" NAME="user_name" VALUE="'. $user_name .'" SIZE="10" MAXLENGTH="15">
<P>
<B>Password:</B><BR>
<INPUT TYPE="password" NAME="password1" VALUE="" SIZE="10" MAXLENGTH="15">
<P>
<B>Password (again):</B><BR>
<INPUT TYPE="password" NAME="password2" VALUE="" SIZE="10" MAXLENGTH="15">
<P>
<B>Email (Required - Must be accurate to confirm):</B><BR>
<INPUT TYPE="TEXT" NAME="email" VALUE="'. $email .'" SIZE="20" MAXLENGTH="35">
<P>
<Input type=hidden name=Joined
value="<?php $cur_date = date ("Y-m-d" '.$cur_date.'; ?>">
<P>
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Send My Confirmation">
</FORM>';
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.