The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > PHP


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags: , ,

Reply
 
LinkBack Thread Tools    Display Modes   
  #11 (permalink)  
Old 06-16-2007, 04:24 PM
Nutter Nutter is offline
Novice
Join Date: Jun 2007
Posts: 22
iTrader: (0)
Nutter is on a distinguished road
PHP: Error Messages Explained - Manual

The if / then is displaying an error if there is one, or the file information if there isn't an error.

__________________
- Ryan
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #12 (permalink)  
Old 06-16-2007, 11:48 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,122
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Quote:
Originally Posted by Nutter View Post
PHP: Error Messages Explained - Manual

The if / then is displaying an error if there is one, or the file information if there isn't an error.
I know what's the use of if / else statement. It's just that I'm confused to what's the code that I posted *earlier* is checking? Where's in that code has the possibilities of error?

Quote:
if the file is corrupt it will say that theres an error in the file
Hmm.. pretty make sense with the file corrupt, but I don't think it would check what's within the file right? *I'm talking about $_FILES['file', 'error']*

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #13 (permalink)  
Old 06-17-2007, 04:41 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee is just really niceLee is just really niceLee is just really niceLee is just really nice
Quote:
Originally Posted by HelloWorld View Post
I don't think it would check what's within the file right? *I'm talking about $_FILES['file', 'error']*
Well if you look at your code, the lines that include code such as:
PHP Code:
$_FILES["file"]["name"]
$_FILES["file"]["type"]
$_FILES["file"]["size"
Are all to do with checking the actual file, it checks its name, type and size, then you have the code:
PHP Code:
$_FILES["file"]["error"
So this means its checking the file for an error, to break it down:
PHP Code:
$_FILES["file"
refers to the file and then its followed by something else, as you can see above its either looking for the name, type, size and also its looking for any errors.

Just a little scenario, lets say your uploading a picture and your Internet crashes meaning the picture is not uploaded fully, the file would then contain errors, the php code will therefore not show statistics on file like the name and size but will handle the file in its own way.

hope that helps you see why it is checking the file for errors and not the php code.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by Lee : 06-17-2007 at 04:45 AM.
Reply With Quote
  #14 (permalink)  
Old 06-17-2007, 09:50 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,122
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Quote:
Originally Posted by Lee View Post
Are all to do with checking the actual file, it checks its name, type and size, then you have the code:
PHP Code:
$_FILES["file"]["error"
So this means its checking the file for an error, to break it down...
When did we specified the name, type, and size of the file?

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #15 (permalink)  
Old 06-17-2007, 10:03 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee is just really niceLee is just really niceLee is just really niceLee is just really nice
We dont, it looks at the file, all these actions are carried out when the file is upload, it then looks at the file size like 1349 bytes (code above converts to KB), the name gets the name of the image, if you upload a file "testing.gif" then the name will be testing, and the type will be gif.

You get what i mean?

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #16 (permalink)  
Old 06-17-2007, 10:08 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,122
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Quote:
Originally Posted by Lee View Post
We dont, it looks at the file, all these actions are carried out when the file is upload, it then looks at the file size like 1349 bytes (code above converts to KB), the name gets the name of the image, if you upload a file "testing.gif" then the name will be testing, and the type will be gif.

You get what i mean?
Alright, thanx Lee for helping! Rep added

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #17 (permalink)  
Old 06-17-2007, 10:13 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee is just really niceLee is just really niceLee is just really niceLee is just really nice
Quote:
Originally Posted by HelloWorld View Post
Alright, thanx Lee for helping! Rep added
Your welcome, glad it helped

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
Reply


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

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



All times are GMT -7. The time now is 07:13 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50