警告:date():并且无法修改联系表单上的标题信息

i had a little contact form from the net and trying to insdtall it but i am getting these 2 errors and i must admit, i am not very good with php esp server side. the errors are:

Error 1: *Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function.* contactform/include/class.phpmailer.php on line 1612 and the same warning for line 1616 of the same file class.phpmailer.php

line 1612 to line 1616 of class.phpmailer.php is

1612- $tz = date('Z');
1613- $tzs = ($tz < 0) ? '-' : '+';
1614- $tz = abs($tz);
1315- $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
1316- $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);

Error 2: Warning: Cannot modify header information - headers already sent by (output started at /home/massa/public_html/mydomain.com/folder/contactform/include/class.phpmailer.php:1612) in /home/massa/public_html/mydomain.com/folder/contactform/include/fgcontactform.php on line 143

line 143 of fgcontactform.php is .

143-  header("Location: $url");
144-  exit;

I must specity this are not my codes, its just a free basic contact form i had on internet and try to implement it on my site.. Any help will be appreciated. Just how to insert the right time zone on line 1612 and what to insert in line 143 of the other file.. Thanks in advance. Michelle

The problem is in your php.ini settings. Follow the warning's suggestion and either edit the file and add this:

date.timezone="Australia/Sydney"

Or alternatively, add the call to date_default_timezone_set("Australia/Sydney") somewhere in the beginning of your code.

Once the error is resolved, your other problem will be gone as well. PHP echoes all errors it encounters and unless your output is buffered, it will send the HTTP response headers along with the first thing it outputs. After that it will be too late to use header('Location: ...') because the headers are already sent to the client.