andy40 Posted February 23, 2010 Share Posted February 23, 2010 Hi i had someone join my affiliate and now i have this error below plus when they login the quicknav bar on the right goes to the bottom of the page can anyone help?? Warning: Division by zero in /home//public_html/support/admin/affiliates.php on line 0 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 Can you provide anymore details? There's not really a whole lot to go by here. Some screen shots or some code blocks could be helpful. Hi i had someone join my affiliate and now i have this error below plus when they login the quicknav bar on the right goes to the bottom of the page can anyone help?? Warning: Division by zero in /home//public_html/support/admin/affiliates.php on line 0 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 Hi in WHMCS when i look at affiliates it as this error below and also when i login as the client the error is at the top of the page plus it makes the page go over to the left and the quicknav bar on the right go down to the bottom but its fine on all other pages on get the error when i click affiliates Warning: Division by zero in /home//public_html/support/admin/affiliates.php on line 0 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 To start with, you probably want to disable errors if you're on a production site. You can turn them off in your php ini file, or in your root folder for WHMCS create a file called .htaccess and paste the following line in it: php_flag display_errors off See if that fixes the display issue, it might just be the error message that's breaking your template. 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 hi i have a httaccess file in there with announcements / download / knowledgebase in there do i add the line to that file and where abouts? 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 hi i have a httaccess file in there with announcements / download / knowledgebase in there do i add the line to that file and where abouts? It doesn't matter where, just as long as it's in there on it's own line. It doesn't make the error go away, something is still trying to divide by zero, but it wont' show it on the screen anymore, so your clients won't be able to see it. 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 Also, make sure the file name is .htaccess and not htaccess.txt. By default, they put it in there as htaccess.txt but his has to be renamed to .htaccess in order for it to be active. If it wasn't active, make sure to either remove the lines with announcments/downloads/knowledgebase or enable SEO friendly URLs in the admin area. 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 hi did that but nothing happend and also it only does it when i am logged in with the one customer who joind tonight all the oters are fine ? 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 hi did that but nothing happend and also it only does it when i am logged in with the one customer who joind tonight all the oters are fine ? You did that, and the error still appears on the page? And just to clarify, this is doing this in the client area when you are logged in with the client, not when you're logged in through the admin area? Did you customize the affiliates page template at all? 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 client area yes and i did customize the portal but only added a link to home page and live chat on the top but that was a while back had others join since and it never happend then 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 You said nothing happened at all when you changed .htaccess. The error should have disappeared from the screen. Are you sure the file name is right? Don't forget the period in the front. 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 yes file name was right but nothing changed i cant understand why it happend 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 I'm not sure either, it's really hard to say, I can't see the page, or the code, so I'm kind of just guessing here. From looking at the error something is trying to divide by zero. This is happening on line 0, so I don't really know where since line 0 doesn't really exist. Can you attach or PM me a screenshot of the page with the error? You might want to block out the client's information first though before posting. 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 sent a pm with a link on 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 hi i have just uploaded a new affiliates.tpl in the portal and the Quick Navigation as come back to the top but i still have the error on the top plus the page is to the left still 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 hi just changed it to default instead of portal and it was still the same so its nothing to do with them 0 Quote Link to comment Share on other sites More sharing options...
epicconstruct Posted February 23, 2010 Share Posted February 23, 2010 hi just changed it to default instead of portal and it was still the same so its nothing to do with them You need to figure out why your errors are being displayed on screen. Since it's a live site, you want them to be logged instead of shown on screen anyways. Once they are hidden, I suspect the style errors will go away. The only thing I can think of that would be generating the warning is when the page calculates the conversion rate, since it would be dividing the sales by the referrals, and since both are 0 it would be dividing by zero if it isn't caught properly. Since the program is encrypted I can't see what they're doing. Other then that, I don't know what else I have to offer, it's really hard to diagnose something when I can't see the code myself. Maybe someone else has gotten the same error themselves or perhaps WHMCS can offer a suggestion. 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 Hi thanks for the help i am going to upload WHMCS again i have made a backup of the database and that should sort it all out then 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 put a new install of WHMCS and it was still the same so dont know what to do now as i cant think what it can be 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 23, 2010 Author Share Posted February 23, 2010 i have done a search all over the net and cant find anything about this problem 0 Quote Link to comment Share on other sites More sharing options...
cgoleman Posted July 12, 2010 Share Posted July 12, 2010 I know this thread is a bit old, but I recently ran into this issue in the affiliates module in WHMCS and thought I would share what I found. This problem was happening on my installation for one affiliate only as well, all the other affiliates did not throw this error. In looking at this one affiliates account I noticed that they had zero referrals, just happens to be a company we do a lot of business with and they send their client details to use via phone/email and we setup the accounts for them and mark them as the affiliate for the account - so they have never actually refered any traffic to our site using their affiliate link, i.e. http://domain.com/whmcs/*?aff=123 I resolved the divide by zero warning by pasting their affiliate link into a browser and hitting it once. This seems to be a defect in the WHMCS affiliate module code - they should be handling that condition in their code. Hope this helps someone who may run into this in the future. 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.