Jump to content

upload password


xtreme_dry

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.