How To Fix Warning: Division By Zero In /var/html/public/phpf.php On Line 3



How To Fix Warning: Division By Zero In /var/html/public/phpf.php On Line 3
 (328) Domains for just $1.99 1751586
How To Fix Warning: Division By Zero In /var/html/public/phpf.php On Line 3
Post Description:
Post Tags: how, to, fix, warning, division, by, zero, in, var, html, public, phpfphp, on, line, 3
This Post Has Been Viewed 4786 Times Since Fri Nov 17, 2006 11:19 am Posted By unix with 2 replies
How To Fix Warning: Division By Zero In /var/html/public/phpf.php On Line 3
ok, today i will try to show you why you are getting this error, as i was also getting it and this is what i did to solve it (fix it)

1. on line 3 on my phpf.php file i had:

     Code:
$pagid=($_GET[pagid] / $pagid_decorder);


2. However, when i changed it to a number manually i didn't get the error anymore: i change line 3 to:

     Code:
$pagid=($_GET[pagid] / 651);


3. After i changed it to an intiger (978) number, it worked without the error, so this tells me there is a problem with the declaration of the $pagid_decorder integer, so i need to check where i declare it. I found the file where i declare this integer and it said:

     Code:
$pagid_decoder=651;


6. You see what the problem is, i have mispelled pagid_decoder to pagid_decorder. ( i put an extra "r" after the letter o)

7. After I corrected this, my script worked like a charm and i didn't get the error anymore. so basically, if you are also getting this error and wondering why you are getting it, its because you may have a mispelled word.

8. However, if you checked and you have the correct spelling of the variable, then you have to look at the error, you are infact dividing by zero. which means, you have not declared the variable, in other words, the variable has no value its NULL.

9. hope this helps




Warning: Division by zero in

Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Fix Warning: Division By Zero In /var/html/public/phpf.php On Line 3




:: 1 :: #11943 - Reply By Luke On Sat Jul 21, 2007 12:05 pm
reckon you hit the nail on the head here - thunk yow: -warning: division by zero
:: 2 :: #44982 - Reply By Michael raj On Mon Mar 10, 2008 9:56 pm
your example is nice to me.well and good