dsklzerpx64815631 2012-10-07 09:38 采纳率: 100%
浏览 18
已采纳

致命错误:调用database.php中的未定义函数[关闭]

UPDATE Suddenly - without changing anything - it works again ON SOME PAGES, on others it doesn't even show the result of my function function_exists('decod'), any ideas why?

I get this error:

Fatal error: Call to undefined function decod() in database.php on line 10

It worked fine before, here's database.php:

//Decode base64
function decod($string){ 
  $string = base64_decode($string); 
  return ($string); 
} 

//Data double-coded with base64, just to prevent people reading
$host = "localhost";
$user = decod(DOUBLE_ENCRYPTED_USERNAME);
$pass = decod(DOUBLE_ENCRYPTED_PASSWORD);
$db = decod(DOUBLE_ENCRYPTED_DATABASE);

//Connect or print error
$con = mysql_connect($host, decod($user), decod($pass));
if (!$con)
{
    die('Could not connect: ' . mysql_error());
}
//Select database
mysql_select_db(decod($db), $con);
  • 写回答

3条回答 默认 最新

  • dongqianzhan8325 2012-10-07 13:08
    关注

    Human error - turns out my website was pointing at the wrong database.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?