943,660 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 300
  • PHP RSS
Aug 15th, 2009
0

Need help with uploading.....

Expand Post »
I have an uploading script but i don't know what is the problem it always gives "Error". Here is the script
<?php
include ("include/session.php");
$username = $session->username;

if ($_REQUEST[completed] == 1) {
$newname = $username . ".gif";
move_uploaded_file($_FILE['mailfile']['tmp_name'], "./$newname") or die("Error");
}
?>
<?php if ($_REQUEST[completed] != 1) { ?><b>Please upload an image</b>
<br />

<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1500000"> <input type="hidden" name="completed" value="1"> Choose file to send: <input type="file" name="mailfile"><br /><input type="submit" value="Upload">
</form>

<?php

} else {

?>

<b>File Uploaded</b>

<?php

}

?>
Please help me........
Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mynameis is offline Offline
2 posts
since Aug 2009
Aug 15th, 2009
0

Re: Need help with uploading.....

Check if the webserver has permission to write to your tmp- and your destination-folder. This is the only thing I can think of right now.
Reputation Points: 56
Solved Threads: 29
Posting Whiz in Training
sDJh is offline Offline
255 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Help with Implementing email form validations please
Next Thread in PHP Forum Timeline: Protection Function





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC