Jump to content

westen

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

westen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Really? That is what I had originally, i did not think it made any difference but someone on another forum told me to change it. It is still giving the same error anyway.
  2. I get ~./uploads/boo.jpg~ which I think is right, uploads is a directory in the same directory as the php file. Cheers, Nick
  3. I am at a total loss, I emailed my web host, they looked at the code and claimed it should work too. Support call closed. God damn it.
  4. bah, must be another problem then
  5. Now I want to cry, it gave me the upload successful message once (but the uploaded file was empty), I didn't change anything and now it is saying I do not have permission again. I am really confused. From what I can tell 0755 is what I want on my directory isn't it? My php files are in /public_html and my upload folder is /public_html/uploads, I cannot see what I am doing wrong. Thank you, NT
  6. Apologies, I just changed it back and it works fine. It must have been a different problem that made me change it in the first place. Sorry for wasting your time. Maybe I will get around to answering some stupid questions when I know more to pay back the stupidity. Cheers, Nicholas
  7. Yes I did, thank you. I do not have permission to write to file. The uploads folder lists 0644 under permissions (this is a folder I created and it started out as 0755 but I changed it to be the same as the others which I assumed was writable). I do not even know what this is or should be. This is the first site I have tried to set up. Cheers, Westen
  8. My form code looks like this. What would I have to change th permissions on if that is the problem. Apologies for my ignorance. <form action="register.php" enctype="multipart/form-data" method="POST" class="register"> <p><br/></p> <label for="username" class="textb">Username:</label> <input type="text" name="username" size="20" maxlength="10" value="<?php echo $username;?>"/></p> <label for="name" class="textb">Name: </label> <input type="text" class="textb" name="name" size="20" maxlength="20" value="<?php echo $name;?>"/></p> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <label for="upload" class="textb">Upload Photo: </label> <input type="file" name="uploadedfile"/></p> <label for="password" class="textb">Password: </label> <input type="password" name="password" size="20" maxlength="10" value="<?php echo $password;?>"/></p> <label for="confirmpassword" class="textb">Confirm Password: </label> <input type="password" name="confirmpassword" size="20" maxlength="10" value="<?php echo $confirmpassword;?>"/></p> <input type="hidden" name="submitted" value="TRUE"/></p> <div id="standard"> <input type="submit" name="submit" value="Create Account"/></p> </div> </form>
  9. I am trying to implement a very simple photo upload. For some reason $_FILES['userfile']['tmp_name'] does not exist, could anyone tell me why? Here is the php: [pre] if(isset($_FILES['uploadedfile'])) { $target_path = "./uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; echo ("<p>file name: " . $_FILES['uploadedfile']['name']); echo ("<p>temp name: " . $_FILES['uploadedfile']['tmp_name']); echo ("<p>target path: " . $target_path); } } [/pre] It outputs: There was an error uploading the file, please try again! file name: photo.jpg temp name: target path: ./uploads/photo.jpg Any help would be much appreciated. I am new to php and this has me baffled. Cheers, Westen
×
×
  • 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.