Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Show Posts
Pages: [1]
1  T35 Hosting Support / Free Hosting General Support / Re: folder permissions on: October 31, 2005, 03:55:42 AM
Log in into your account, select the folder you want to change. Click the CHMOD button near to the right side of the screen. Change the chmod value to 777 and press enter.

Done! smiley
2  Web Design & Developement / Programming / uploading script help on: October 30, 2005, 11:57:58 PM
I have tried multiple scripts on the internet but I can't get any of them working.

<?php
// Upload settings
$folder = "uploads/"; // Folder in which to store files
$maxlimit = 1000000; // Set maximum file limit (in bits)
$allowed_ext = "jpg,gif,png,jpeg"; // Set allowed extensions (split using comma)
$overwrite = "yes"; // Allow file overwrite? yes/no

$match = ""; // Clear match variable; for security purposes
$filesize = $_FILES['userfile']['size']; // Get file size (in bits)
$filename = strtolower($_FILES['userfile']['name']); // Get file name; make it all lowercase

if(!$filename || $filename==""){ // File not selected
   $error = "- No file selected for upload.";
}elseif(file_exists($folder.$filename) && $overwrite=="no"){ // Check if file exists
   $error = "- File already exists: $filename";
}

// Check if file size
if($filesize < 1){ // File is empty
   $error .= "- File size is empty.";
}elseif($filesize > $maxlimit){ // File is more than maximum
   $error .= "- File size is too big.";
}

$file_ext = preg_split("/./",$filename); // Split filename at period (name.ext)
$allowed_ext = preg_split("/,/",$allowed_ext); // Create array of extensions
foreach($allowed_ext as $ext){
   if($ext==$file_ext[1]) $match = "1"; // File is allowed
}

// File extension not allowed
if(!$match){
   $error .= "- File type isn't allowed: $filename";
}

if($error){
   print "Error trying to upload file: $error"; // Display error messages
}else{
   if(move_uploaded_file($_FILES['userfile']['tmp_name'], $folder.$filename)){ // Upload file
      print "Success! The file has been uploaded: $filename";
   }else{
      print "Error! File size might exceed upload limit of server. Try again."; // Display error
   }
}

?>

^uploader.php

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 3</title>
</head>

<body>

<form enctype="multipart/form-data" method="post" action="up.php">
Select file: <input type="file" name="userfile">
<input type="submit" value="Upload">
</form>

</body>

</html>

^loader.htm

any help would be appreciated.
Pages: [1]
Powered by SMF | SMF © 2006-2008, Simple Machines LLC