WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Why it is not possible to preset a value in a file upload field
Categories : HTML, Security, Filesystem, Beginner Guides
Boaz Yahav
Date : Jan 07th 2003
Grade : 3 of 5 (graded 2 times)
Viewed : 3538
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Boaz Yahav
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Did you ever try to do something like :

<HTML>
<BODY>
<FORM ENCTYPE="multipart/form-data" NAME="MyForm" ACTION="SomeFile.php" METHOD="POST">
<INPUT NAME="file" TYPE="file" VALUE="c:\MyDir\MyFile.txt">
</FORM>
</BODY>
</HTML>


But when you look at the HTML and expect to see c:\MyDir\MyFile.txt in the file field you actually
get an empty field.

Well, it's not a bug, it's actually a security feature :). Suppose that you could set a value in that field, what will prevent you from accessing practically any file on the computer of someone visiting your site?

All you need to do, is set this field with the path and name to any file on the visitors computer and submit the form (Can be done by Java Script without the user even knowing about it).

Hope you didn't try to preset that value for too long before you read this.



Introduction to Language Files
Categories : PHP, Filesystem, Beginner Guides
A flat file counter
Categories : PHP, Cookies, Filesystem, Beginner Guides
Creating a Language File
Categories : PHP, Beginner Guides, Filesystem
How to keep your tables width stable even if you have long strings inside.
Categories : CSS, Web Browsers, HTML, Beginner Guides
A very simple PHP single password cookie based login without usernames.
Categories : PHP, Cookies, Security, Beginner Guides
PHP based Contact email form with multiple recipients, text file based, supports departments.
Categories : PHP, Email, Beginner Guides, Filesystem
A damaged image generator (class) for validating text. CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart
Categories : PHP, PHP Classes, Security, GD image library, Security
How to preset a text string in a textarea input field
Categories : HTML, HTML and PHP, PHP, Beginner Guides
Convert a File database into MySQL
Categories : PHP, Filesystem, Databases, MySQL, Beginner Guides
A function to clean input coming from form fields (Minimize the risk for XSS and SQL Injection attacks).
Categories : Beginner Guides, Security, Data Validation
Human readable PHP password generator
Categories : PHP, Security, Beginner Guides, Arrays
Rollover Image link effect using only single image.
Categories : Web Design, HTML, CSS, Beginner Guides
complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password. improved security using time functions to initialize random number generator.
Categories : Java Script, HTML, Security, Authentication, Strings
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides