Error on line... 15... parse? Help please

Check out tizag.com

Oh man…

My head is burning. I can’t even do the time and date stamp…

Really everybody, any hint in the right direction please, is really welcome.

I have gone past getting the customers IP address. All needed really is date and time. And after having all this done, I will then pass onto MySql so that I can get an query ID number that I can have forwarded to myself with the data form and to the customer. This will serve as reference.

Cheers.

$date = date("n-j-Y g:ia",time());

Lets break it down,

$date =
This assigns a variable name date

date(
This uses the date function of php to output a formatted string based on a time stamp, see -> PHP: date - Manual

“n-j-Y g:ia”,
This is the date time format you specify based on the format characters accepted (see previous link) for now (and my timezone) you would see 3-30-2011 5:00pm

time()
Sets the timestamp for date formatting to the current server time.

);
Closes the date function and ends the line.

Now you just call your $date variable wherever you want it to show up, and it will always update with the server time when the script is executed.

Hope that helps, good luck.

Hello mate.

I can’t believe that after all them variables that I had managed to put bit by bit and following the sctructure of another form I have previously downloaded from the internet, that I could not get shuch simple instruction of code to get the date working.

I am embarassad.

Somedays I am just so p***** off that it just wont sunk in and then the next day the same thing and its like, what??? is that it?

Sometimes the head does need a good rest.

I got the date working now, thanks to your help and description.

I managed to get an e-mail reply with the data that I am looking to get from the form and it like this;

IP: 86.177.37.192
Date: 2011-03-19
Time: 19:09:08
Reference ID: 20110319-b4a5

I am not bothered with the IP address really unless I want to stop the same IP address from submiting the form more than a few times a day.

However I would like to have the Reference ID working but like it has been sugested here, it is done with MySql and of that I know nothing about it.

Any good link to start reading about sql databases really apprecited.

Once again, thank you everybody for your help and support.

Kind regards,
Albert, C
Goodnight

PHP MySQL Introduction is really the only thing I know to get ya started, I learned from a book, this one actually -> [url=http://www.amazon.com/PHP-MySQL-Development-Luke-Welling/dp/0672317842]Amazon.com: PHP and MySQL Web Development (0752063317846): Luke Welling, Laura Thomson: Books I’m sure someone around here will have something better for ya.

Hi.

I have done the date as mentioned before but that is only going on the e-mail to the customer.

I have done some changes to the e-mail that I receive with the data like so;

$body ="We have received the following information:\
\
"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\
",$b,$_REQUEST[$a],$date);}

As you can see, I have inserted the $date at the end of that line but to no effect. I tried other ways but Dreamwever keept reporting it as error.

Again lost… lol.

Thanks for the link and I might as well just buy that book too.

Cheers.

try



$body ="We have received the following information:\
\
"; 
foreach($fields as $a => $b){ 
   $body .= sprintf("%20s: %s\
",$b,$_REQUEST[$a]); 
}
$body .= $date;

Was just readiung the reviews on the book and have just purchased it.

Thanks for the code.

I will have to read about the sintax, struture of it as I honestly though that adding that extra bit at the end would do the trick like in other cases.

Cheers.
Albert, C