Jump to content

andy5898

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

andy5898's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yep, you have hit the nail on the head. Any ideas on how I do it? Cheers
  2. What I want to do is create a page, where I can have uploaded files, then someone else goes in and downloads them to there computer. It sounds simple enough but I am guessing it isn't. Has anyone got any advise on how to do this? Cheers
  3. I have a comments form on my website with the boxes email, message and name. However at the minute it is going through some company's script and so gets sent to an external website. Does anyone have a PP code I could use so it is all done via my own website? Cheers
  4. Hi, I am uploading to my website using the following script <?php // Check for a valid password to prevent unauthorised uploads // Change 'password' to the name of the password field on your form (if there is one) $pass = ''; if (isset($_POST['password'])) $pass = $_POST['password']; // Change 'yourchoice' to the password you will use // If you don't want to use a password, just specify '' if ($pass != '') { die ('Password not recognised'); } // Specify the types of file you want to allow, separated by commas $allowedTypes = array('.jpg','.gif','.bmp','.png','.001','.xls','.doc'); // Specify the maximum file size you will accept $maxsize = 10000000; // Specify the folder that will receive the uploaded files, with trailing backslash $destination = 'myfiles/'; // Replace 'formfile' with the name of the file browser field on your form $upfile = $_FILES['formfile']; if ($upfile['name']<>'') { if (is_uploaded_file($upfile['tmp_name'])) { $filetype = strstr (basename($upfile['name']),'.'); $filetype = strtolower ($filetype); if (!in_array($filetype,$allowedTypes)) { die ("Invalid file format: ".$filetype." ".$upfile['type']); } $filesize = $upfile['size']; if ($filesize > $maxsize) { die ("File size exceeds maximum allowed"); } } else { die ("This is not an uploaded file"); } } else { die ("Please specify a file name"); } $filename = basename($upfile['name']); $copyto = $destination.$filename; move_uploaded_file($upfile['tmp_name'],$copyto) header('Location: http://www.cbmaccounts.co.uk/successful.html/'); exit; ?> It all works fine I can upload etc, but when it has uploaded successfully it won't take me to the page I want it too. Can anyone tell me what Im doing wrong and how I fix it? Cheers
×
×
  • 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.