Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'uploading a file'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. !doctype html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST'){ if (move_uploaded_file($_FILES['the_file']['tmp_name'],"C:\uploads\{$_FILES['the_file']['name']}")) { print '<p>your file has been uploaded.</p>'; }else { print '<p style="color:red;">Your file couldnot be uploaded because :'; switch ($_FILES['the_file']['error']) { case 1: print 'the file excceeds the upload_max-file size setting in php.oni'; break; case 2: print 'The file exceeds the max-FILE_SIZE SETTING IN THE HTML FORM'; break; case 3: print 'The file was only partially uploaded'; break; case 4: print 'No fil was uploaded'; break; case 6: print 'The temporary folder does not exixts,'; break; default: print 'something unforeseen happend'; break; } print '.</p>'; } } ?> <form action="upload_file.php" enctype="multipart/form-data" method="post"> <p> Upload a file using this form:</p> <input type="hidden" name="MAX_FILE_SIZE" value="300000"> <p><input type="file" name="the_file"></p> <p><input type="submit" name="submit" value="upload this file"></p> </form> </body> </html> when i try to run this i get this error: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\PHPexamples\chapter11\upload_file.php on line 10 not understanding move_uploaded_file() function here. if i am right, i should be able to upload any file from PC and load it to uploads folder? its bit confusing and not clear ,,page 318-320 .. i didnt even get html form to upload any file. i had saved jpg file in some different directory and wanted to upload that and move it to uploads folder.. please some one explain. thank you.
×
×
  • Create New...