Call to undefined function
Posted: 20. March 2008 12:50
Hi, I'm having a problem running a php script with XAMPP. It works perfectly on any host I've ever used, but XAMPP just doesn't want to run it.
Error:
General location of the error being found:
Function get_config() is inside config.php in the same folder.
Heres the contents of config.php:
Can anyone tell me what I'm doing wrong?
Error:
- Code: Select all
Fatal error: Call to undefined function get_config() in C:\xampp\htdocs\phixin\inc\php\common.php on line 16
General location of the error being found:
- Code: Select all
include 'config.php';
$config = get_config();
function microtime_float() {
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
Function get_config() is inside config.php in the same folder.
Heres the contents of config.php:
- Code: Select all
<?php
function get_config() {
return array(
'db-host' => 'localhost',
'db-user' => 'root',
'db-pass' => '',
'db-table' => 'grabit'
);
}
Can anyone tell me what I'm doing wrong?