Jump to content

shadowblade

Members
  • Posts

    3
  • Joined

  • Last visited

Contact Methods

  • AIM
    shadowblade668
  • Website URL
    http://ashafer.org
  • ICQ
    0

Profile Information

  • Location
    Kalamazoo, MI, US

shadowblade's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Something that needs to be fixed right away...On the file upload section (http://w3schools.com/php/php_file_upload.asp) the file_exists() function is called, but the value passed to it is the user's file name, so with the given setup, the script will always stop because the file that the user selected to upload does in fact exist.This can be fixed like so... <?php$userfile = $_FILE['formfile']['name'];$name = basename($userfile);$dir = "some_upload_directory/";if (file_exists($dir.$name)) //code?> On that note, a few other things I'd like to see in the file upload section are a reference of MIME types for common files (and the fact that $_FILE["file"]["type"] is a MIME type and not just a common extension - afaik this isn't mentioned anywhere).Also, I don't think it is mentioned ever that the "file" in $_FILE["file"] is the name of the file field in the form. I can see this being very confusing for a beginner. It should be changed to something to differentiate it from the $_FILE array.
×
×
  • Create New...