Lukemob Posted September 26, 2010 Share Posted September 26, 2010 Hello guys, when I want to add own page (after http://wiki.whmcs.com/Creating_Pages) and edit the code a bit. eg. import own functions and give there some if-conditions, the script stops to work. Code here: http://pastebin.com/yZL1XL1Q How should I do it? What should I change? Thanks.. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 26, 2010 Share Posted September 26, 2010 What is in _functions.php? 0 Quote Link to comment Share on other sites More sharing options...
Lukemob Posted September 26, 2010 Author Share Posted September 26, 2010 My own functions.. is there a possibility that some function is the same-named as the functions from WHMCS and that's causing errors? But well, I know for sure.. that I have no function called outputClient*** in my functions. Should it work normally? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 26, 2010 Share Posted September 26, 2010 If you have duplicate function names it can cause issues. Have you tried turning on display_errors? 0 Quote Link to comment Share on other sites More sharing options...
Lukemob Posted September 26, 2010 Author Share Posted September 26, 2010 If you have duplicate function names it can cause issues. Have you tried turning on display_errors? Aha I didn't know about this function, I will try. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 26, 2010 Share Posted September 26, 2010 add the following code to configuration.php: $display_errors = true; 0 Quote Link to comment Share on other sites More sharing options...
Lukemob Posted September 26, 2010 Author Share Posted September 26, 2010 Next problem.. I have my own language file Czech.txt in lang/ folder and when I try to set the language to Czech.. it says: Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/pozdisek.cz/subdomeny/wl/whmcs/whmcs/dbconnect.php(0) : eval()'d code on line 347 0 Quote Link to comment Share on other sites More sharing options...
Lukemob Posted September 26, 2010 Author Share Posted September 26, 2010 The next error: Fatal error: Cannot redeclare redirect() (previously declared in /home/www/pozdisek.cz/subdomeny/wl/whmcs/whmcs/include/_functions.php:15) in /home/www/pozdisek.cz/subdomeny/wl/whmcs/whmcs/include/_functions.php on line 21 0 Quote Link to comment Share on other sites More sharing options...
bear Posted September 26, 2010 Share Posted September 26, 2010 Can you tell us what's on that line in that file, please? 0 Quote Link to comment Share on other sites More sharing options...
Lukemob Posted September 26, 2010 Author Share Posted September 26, 2010 function redirect($to,$secs="") { if($secs!=$null) { echo '<META HTTP-EQUIV="Refresh" CONTENT="'.$secs.'; URL='.$to.'">'; } else { echo '<META HTTP-EQUIV="Refresh" CONTENT="3; URL='.$to.'">'; } } 0 Quote Link to comment Share on other sites More sharing options...
Lukemob Posted September 26, 2010 Author Share Posted September 26, 2010 even renaming of the functions doesnt help.. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 26, 2010 Share Posted September 26, 2010 How do you mean it doesnt help? Surely the error is different when changing it. You should try to use script-specific function names anyways to avoid this kind of problem. scriptname_redirect() for example. Also, your if statement doesnt make sense either, unless you're defining $null somewhere.. That should probably read something like this: if (!$secs) { // Do this } else { // Do that } Even better would be something like this: function script_redirect($to, $secs="3") { echo '<META HTTP-EQUIV="Refresh" CONTENT="'.$secs.'; URL='.$to.'">'; } 0 Quote Link to comment 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.