xtreme_dry Posted March 1, 2007 Share Posted March 1, 2007 hey im not really a php coder but i managed to write a little upload script and i was just wondering how would i go about setting a password box up with a predefined password? here's my script: <?php $tpage = "Download.html"; $size= "size.htm"; $extpage = "extpage.htm"; $exist = "exist.htm"; $notselect = "notselect.htm"; $elimit = "yes"; $lext = array(".gif",".jpg",".doc",".mdl"); $file_tmp = $_FILES['file']['tmp_name']; if (!is_uploaded_file($file_tmp)){ echo header("Location: $notselect"); exit(); } if (($_FILES["file"]["size"] < 500000)) { $fname = $_FILES['file']['name']; $fname = str_replace(' ', '_', $fname); if (file_exists("uploads/" . $_FILES["file"]["name"])) { echo header("Location: $exist"); } else { move_uploaded_file($_FILES["file"]["tmp_name"], "uploads/" ."$fname" ); header("Location: $tpage"); } } else header("Location: $size"); ?> Link to comment https://forums.phpfreaks.com/topic/40663-upload-password/ Share on other sites More sharing options...
xtreme_dry Posted March 1, 2007 Author Share Posted March 1, 2007 bump Link to comment https://forums.phpfreaks.com/topic/40663-upload-password/#findComment-196874 Share on other sites More sharing options...
Orio Posted March 1, 2007 Share Posted March 1, 2007 Check this: http-auth in php. Orio. Link to comment https://forums.phpfreaks.com/topic/40663-upload-password/#findComment-196881 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.