Warning: Division by zero in /home/warezddl/domains/warezddl.info/public_html/edit.class.php on line 125 Below <br>Ratio is currently <b>".round($t[inn]/$t[ut], 4)."</b><br><br> its a DDL Script and i have this problem only on admin main page wen i login and i cant add users downloads. any ideas what to do Thanx
Maybe: <?php if ( $t[ut] != 0 ) { echo "<br>Ratio is currently <b>".round($t[inn]/$t[ut], 4)."</b><br><br>"; } else { echo 'Whatever else should be displayed if $t[ut] is 0.'; } ?> PHP:
Have you tried to figure it out on your own? If you can't fix those small errors you will never be proficient in PHP.
The message is quite clear: There is a ">" too much. The message even specifies the exact line where the error occured. So go hunt for that and fix it.
ok i tried to delete to > and did and look like this now if ( $t[ut] != 0 ) { echo "Ratio is currently ".round($t[inn]/$t[ut], 4).""; } else { echo 'Whatever else should be displayed if $t[ut] is 0.'; } and i get this error Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' i dont understand where to put it
Let me get my crystal ball... No wait, I don't have one. The error message points out the (approximate) line where the error has occured, and that's where you have to look. It's not rocket science, just look at your code and figure it out.
And how am I supposed to help with that? I don't even know what your code looks like. Go through your code with a fine haired comb and find the mistake. There are editors that offer syntax highlighting which would help in this matter, but if you don't know the basics now you will never learn them.
and i tried changing the number to 0,1,255 is there any other numbers ? The Error Warning: Division by zero in /home/warezddl/domains/warezddl.info/public_html/edit.class.php on line 130 Ok here is the code for the page i am having problems with
I'm neither going to bother counting these lines nor am I going to bother copy&pasting it into my editor to find out where line 130 is. Look through it with a fine haired comb again and again and again until you see it.
$t[ut] is 0... and you can't divide a number by 0. So you need to figure out why $t[ut] is 0 or the code that chopsticks provided above to prevent division by 0. However, it looks like that code has been included. You should not be receiving a division by 0 error.
If you want to PM me the FTP information and the name of the file, I'll give it 5 minutes and see if I can diagnose it.