Unstoppable Domains

Upload code not working

Spaceship Spaceship
Watch

Barrucadu

Established Member
Impact
64
PHP:
<?php

$uploaddir = 'files/';
$name = rand(0,9999999).basename($_FILES['userfile']['name']);
$uploadfile = $uploaddir . $name;

if(filesize($_FILES['userfile']['tmp_name']) > 5120){
	header("Location: http://www.yarrt.com/upload.php?act=too_big");
}
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
	header("Location: http://www.yarrt.com/upload.php?act=done&f=".$name);
}else{
	header("Location: http://www.yarrt.com/upload.php?act=error");
}
?>

It just dosnt upload the file.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
is the "files" folder chmodded to 777?
 
0
•••
ninedogger said:
is the "files" folder chmodded to 777?

*slaps forehead*

I knew it would be a stupid little mistake, lol

edit: nope, that dosnt fix it

edit 2: fixed now (for some reason my host didnt allow file uploading) I had to put the script on another server.
 
Last edited:
0
•••

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back