PHP File Manipulation
File Upload and php.ini ;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir = /tmp ; Maximum allowed size for uploaded files. upload_max_filesize = 8M
Uploading Files in PHP upload.html upload.php – As is it a dangerous file… – Assumes authentication – Users could overwrite existing files
Surfing the Filesystem… browsedir.php browsedir2.php scandir.php filedetails.php – basename() and dirname()
Sessions Session support in PHP consists of a way to preserve certain data across subsequent accesses. This enables you to build more customized applications and increase the appeal of your web site. A visitor accessing your web site is assigned a unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL.
PHP Session Security Without SSL or other encryption your session data is visible!
PHP is Software! (and should be Engineered) Plan out your project – get user input! Reuse code – both internally and via Open Source Write Maintainable (and scalable) Code – Use Standards (variable and function naming) – Commenting – Indentation Breakup code into manageable chunks Implement a versioning system Separate Logic and content (PHP, HTML and CSS) Prototype and Test!
Create PHPbookmark App
Files in PHPbookmark