Current location: Hot Scripts Forums » Programming Languages » PHP » Warning: Division by zero in What does it mean?


Warning: Division by zero in What does it mean?

Reply
  #1 (permalink)  
Old 02-04-06, 11:35 AM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Warning: Division by zero in What does it mean?

What does this error mean?

PHP Code:

 WarningDivision by zero in 

I googled it but came up with actual errors, or just blank or inconclusive forum posts
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 02-04-06, 11:38 AM
ermau's Avatar
ermau ermau is offline
Wannabe Coder
 
Join Date: Aug 2003
Location: Florida, USA
Posts: 240
Thanks: 0
Thanked 0 Times in 0 Posts
It actually cuts off with no line number? Strange.

It means exactly what it says, you have a number somewhere being divided by 0.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 02-04-06, 11:54 AM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
the lines it occurs on are

PHP Code:

 copy ($_FILES['userfile']['name'], "user/" $user_uname $_FILES['userfile']['name'])

    or die (
"Could not copy"); 
So i really don't get it now
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 02-04-06, 12:54 PM
Vineman Vineman is offline
Wannabe Coder
 
Join Date: Dec 2005
Location: Texas
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Its trying to divide $user_uname by $_FILES['userfile']['name'].
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 02-04-06, 01:29 PM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
aah guess that makes sense

So how do i tell it that its a slash not a divide?

hmm, now i get Parse error: parse error, unexpected T_VARIABLE

PHP Code:

 copy ($_FILES['userfile']['name'], "user/.$user_uname/"  $_FILES['userfile']['name'])

    or die (
"Could not copy"); 
On the first line thier, i don't get it, i checked the $_FILES variable too, but that seems fine :/

Last edited by xxvatarxx; 02-04-06 at 01:49 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 02-04-06, 02:05 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
This will probably work (but don't quote me on that) -
PHP Code:

 copy ($_FILES['userfile']['name'], "user/".$user_uname."/".$_FILES['userfile']['name']) 

    or die (
"Could not copy"); 
Because variables are parsed in double quoted strings, this should work as well (but don't quote me if it does not) -
PHP Code:

 copy ($_FILES['userfile']['name'], "user/$user_uname/".$_FILES['userfile']['name']) 

    or die (
"Could not copy"); 
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: Wrong parameter count... Tim Mousel PHP 5 01-23-06 01:10 PM
Warning: session_start(): Cannot send session cache limiter jozin PHP 4 07-13-05 12:47 AM
Warning: mysql_fetch_row(): HELP! SEQUEL PHP 6 03-30-05 10:43 AM
An unknown warning Slypher PHP 1 02-12-05 04:24 AM
Competition form dee19802000 PHP 2 01-27-05 03:48 PM


All times are GMT -5. The time now is 09:03 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.