Session Handling
Its a simple session handling tutorial, bottom of this tutorial has a link to download the zip file.
Its a continuation of user registration process.
Zip File includes.
- user_validation.php
- failure.php
- success.php
- login.html
File Handling
Its a simple file uploading tutorial, bottom of this tutorial has a link to download the zip file.
Zip File includes.
- file_upload.php - file has internal comments in it for better understanding
- file_upload.html
- uploaded - its a directory for holding uploaded files
//Like $_REQUEST, $_GET, $_POST array there is a $_FILES array to hold file information submitted in previuos form
//these are all server generated super global variables.//$_ENV, $_GET, $_POST, $_COOKIE, $_SESSION —————– commonly called EGPCS varaibles
//$_REQUEST, $_FILES, $_SERVER - $_REQUEST contains both GET and POST values
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | //watch the relative path ./ this means that where ever the script runs system will be checking the existence of directory or file in its current directory // relative path ../ implies that the system will be checking the existence of the file or directory in its parent directory $destinationDIR="./uploaded/".$_FILES['filename']['name']; // read the difference between move_uploaded_file function and copy function in PHP manual if(move_uploaded_file($_FILES['filename']['tmp_name'],$destinationDIR)){ echo "File has been uploaded succefully<br><br><br>"; echo "File you uploaded is : <img src='".$destinationDIR."' alt='testme'>"; echo "<br><br><a href='file_upload.html'>click here</a> to upload another file"; }else{ echo "Sorry, This file cannot be uploaded!! <a href='file_upload.html'>click here</a>to try again"; } |






