Answer the question
In order to leave comments, you need to log in
Bugs in PHP code?
Mistake #1 -
Fatal error: Cannot redeclare get_date_time() (previously declared in /var/www/clients/client1/web1/web/kinopoiskgrabber.php:19) in /var/www/clients/client1/web1/web/system/functions/functions .php on line 302
// Returns the current time in GMT in MySQL compatible format.
function get_date_time($timestamp = 0) {
if ($timestamp)
return date("Y-m-d H:i:s", $timestamp);
else
return date("Y-m-d H:i:s");
}
//Определяем время
function get_date_time($timestamp = 0) {
if ($timestamp)
return date("Y-m-d H:i:s", $timestamp);
else
return date("Y-m-d H:i:s");
}
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in
Answer the question
In order to leave comments, you need to log in
Mistake #1
Cause:
Function declared twice (or more)
Solution:
if (!function_exists('get_date_time')) {
function get_date_time($timestamp = 0) {
if ($timestamp)
return date("Y-m-d H:i:s", $timestamp);
else
return date("Y-m-d H:i:s");
}
}
By the 1st mistake, the get_date_time function has already been declared earlier. There can be several options here:
- The function declares some extension to php - the solution is either to find and disable this extension or rename this function
- The file with the function is connected several times
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question