Tomislav Posted September 13, 2013 Share Posted September 13, 2013 Hi all ! I need some help. I'm not a programer but I would like to solve problem with my website by myself. After upgrading PHP on server where is my web page ( www.osmrtnica.net ), i'm getting a lot of errors in my CMS. I hope that someone will have a few minutes to give a look. I have bolded text in code at line 380. And i know that is a lot of text, but what can i do. Thanks in advance. here are the errors: <br /><b>Warning</b>: main() [<a href='function.main'>function.main</a>]: 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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Notice</b>: Use of undefined constant date - assumed 'date' in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: strtotime() [<a href='function.strtotime'>function.strtotime</a>]: 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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: strtotime() [<a href='function.strtotime'>function.strtotime</a>]: 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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: date() [<a href='function.date'>function.date</a>]: 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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: date() expects parameter 2 to be long, string given in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /> And here is a part of code where error ocurs: <div class="h3" style="height:1px;"> </div> <div style="width:450px; float:left; "> <label for="odobreno">odobreno:</label> <input type="checkbox" class="chk" name="odobreno" id="odobreno" value="1"<?php if ($row['odobreno'] == 't') { ?> checked="checked"<?php } ?> /> <label for="datum">datum:</label> <input type="text" name="datum" id="datum" class="tekst srednji" value="<?php if ($row['datum'] != '') print date('d.m.Y', date.strtotime($row['datum'])); else print date('d.m.Y'); ?>" /> <script type="text/javascript"> <!-- $(document).ready(function(){ $('#datum').datepicker({ mandatory: true, navigationAsDateFormat: true, prevText: '<M', nextText: 'M>', changeMonth: false, monthNames: ['siječanj ','veljača ','ožujak ','travanj ','svibanj ','lipanj ', 'srpanj ','kolovoz ','rujan ', 'listopad ','studeni ','prosinac '], monthNamesShort: ['sij','velj','ožu','tra','svi','lip','srp','kol','ruj','lis','stu','pro'], changeYear: false, weekHeader: '', showWeeks: true, dayNames: ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], dayNamesShort: ['ned', 'pon', 'uto', 'srij', 'čet', 'pet', 'sub'], dayNamesMin: ['N', 'P', 'U', 'S','Č', 'P', 'S'], showOtherMonths: true, numberOfMonths: 1, defaultDate: Date(<?= date('Y, m, d', strtotime($row['datum'])); ?>), // default date - Date(yyyy, mm - 1, dd), dateFormat: 'dd.mm.yy', showWeeks: true, firstDay: 1, changeFirstDay: false, closeText: 'X', prevText: '<', nextText: '>', currentText: '' }); }); //--> </script> Quote Link to comment https://forums.phpfreaks.com/topic/282136-date-timezone-problems-after-upgrading-server-to-php-5327/ Share on other sites More sharing options...
vinny42 Posted September 13, 2013 Share Posted September 13, 2013 The error explains what you need to do: "You are *required* to use the date.timezone setting or the date_default_timezone_set() function." So, go to php.ini and set your date.timezone, or make *all your scripts define the timezone using dete_default_timezone_set(). The PHP.ini option is absolutely the best. Quote Link to comment https://forums.phpfreaks.com/topic/282136-date-timezone-problems-after-upgrading-server-to-php-5327/#findComment-1449387 Share on other sites More sharing options...
Tomislav Posted September 13, 2013 Author Share Posted September 13, 2013 The error explains what you need to do: "You are *required* to use the date.timezone setting or the date_default_timezone_set() function." So, go to php.ini and set your date.timezone, or make *all your scripts define the timezone using dete_default_timezone_set(). The PHP.ini option is absolutely the best. I have already done that, here is my php.ini : [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = Europe/Zagreb Quote Link to comment https://forums.phpfreaks.com/topic/282136-date-timezone-problems-after-upgrading-server-to-php-5327/#findComment-1449397 Share on other sites More sharing options...
vinny42 Posted September 13, 2013 Share Posted September 13, 2013 Then your problem is solved? Quote Link to comment https://forums.phpfreaks.com/topic/282136-date-timezone-problems-after-upgrading-server-to-php-5327/#findComment-1449399 Share on other sites More sharing options...
Tomislav Posted September 13, 2013 Author Share Posted September 13, 2013 Then your problem is solved? Almost solved. Now i got this massage in field where was date written : <br /><b>Notice</b>: Use of undefined constant date - assumed 'date' in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: date() expects parameter 2 to be long, string given in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /> Quote Link to comment https://forums.phpfreaks.com/topic/282136-date-timezone-problems-after-upgrading-server-to-php-5327/#findComment-1449403 Share on other sites More sharing options...
Solution jcbones Posted September 13, 2013 Solution Share Posted September 13, 2013 it isn't date.strtotime() it is just strtotime(). The error is telling you that PHP cannot find a constant named date and thinks it is suppose to be a string. Then it throws an error that says the second parameter of date() is passed as a string. Those two clues led me to believe that the "date" part of date.strtotime() was not right. Quote Link to comment https://forums.phpfreaks.com/topic/282136-date-timezone-problems-after-upgrading-server-to-php-5327/#findComment-1449410 Share on other sites More sharing options...
Tomislav Posted September 13, 2013 Author Share Posted September 13, 2013 it isn't date.strtotime() it is just strtotime(). The error is telling you that PHP cannot find a constant named date and thinks it is suppose to be a string. Then it throws an error that says the second parameter of date() is passed as a string. Those two clues led me to believe that the "date" part of date.strtotime() was not right. Thanks man. Quote Link to comment https://forums.phpfreaks.com/topic/282136-date-timezone-problems-after-upgrading-server-to-php-5327/#findComment-1449411 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.