Sheets Posted January 11, 2012 Share Posted January 11, 2012 Hello, i am making a very simple site to test how much i have learned. However i realized i need to simple it down and make it easier for the client side. Could anybody provide me with a link to a good tutorial where it shows how to upload a image to a certain directory then take that link and insert it into my database. Thank you for your time Quote Link to comment Share on other sites More sharing options...
scootstah Posted January 11, 2012 Share Posted January 11, 2012 http://bit.ly/AueG5p Quote Link to comment Share on other sites More sharing options...
Sheets Posted January 11, 2012 Author Share Posted January 11, 2012 oh no of course i didnt do that of course........ /sarcasm it does not explain it Quote Link to comment Share on other sites More sharing options...
KevinM1 Posted January 11, 2012 Share Posted January 11, 2012 What are you having trouble with, specifically? I ask because you simply need to be able to understand example 2 from: http://www.php.net/manual/en/features.file-upload.post-method.php and know how to write and execute an INSERT statement. Do you have any code for us to look at? Quote Link to comment Share on other sites More sharing options...
scootstah Posted January 11, 2012 Share Posted January 11, 2012 oh no of course i didnt do that of course........ /sarcasm it does not explain it Then ask more specific questions. We aren't here to Google things for you. Where are you stuck? Quote Link to comment Share on other sites More sharing options...
Sheets Posted January 11, 2012 Author Share Posted January 11, 2012 <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = '/var/www/uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?> I do not understand exactly what it is doing and why. :-\ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.