Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help me, I am about to punch a whole in my wall.
#1
Okay I'm trying to use this php upload script. But I keep getting this error. "Sorry, there was a problem uploading your file."

here is my code

upload.html
Code:
<form enctype="multipart/form-data" action="upload.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>

upload.php
Code:
<?php
$target = "home/users/web/b60/moo.tdrunner95com/ideviceforums.net/packages_upload/";
$target = $target . basename( $_files['uploaded']['name']) ;
$ok=1;

//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}

//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_files['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_files['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?>

PLEASE HELP ME!
[Image: xQS7F.png]
Reply
#2
I'm really sorry if this doesn't help, but I don't know PHP at all ><

Where is $ok declared? I think the problem you're having is just because it's value is 0.
Reply
#3
(02-22-2012, 04:10 PM)Valderino Wrote: I'm really sorry if this doesn't help, but I don't know PHP at all ><

Where is $ok declared? I think the problem you're having is just because it's value is 0.
No its value if 1... Its checking to see if the value is 0.
[Image: xQS7F.png]
Reply
#4
(02-22-2012, 04:12 PM)iRun Wrote: No its value if 1... Its checking to see if the value is 0.


OH! I totally skipped that line. >< ($ok=1;)

I'm just making wild guesses here, but I guess it's better than nothing... why not try:

declare(ok=1);
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pvc wall panels | Pvc ceiling panel decoin12 0 713 07-10-2017, 09:14 AM
Last Post: decoin12

Forum Jump:


Users browsing this thread: 1 Guest(s)