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 Link to comment https://forums.phpfreaks.com/topic/254757-image-uploadinginserting-link-into-mysql/ Share on other sites More sharing options...
scootstah Posted January 11, 2012 Share Posted January 11, 2012 http://bit.ly/AueG5p Link to comment https://forums.phpfreaks.com/topic/254757-image-uploadinginserting-link-into-mysql/#findComment-1306309 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 Link to comment https://forums.phpfreaks.com/topic/254757-image-uploadinginserting-link-into-mysql/#findComment-1306325 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? Link to comment https://forums.phpfreaks.com/topic/254757-image-uploadinginserting-link-into-mysql/#findComment-1306332 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? Link to comment https://forums.phpfreaks.com/topic/254757-image-uploadinginserting-link-into-mysql/#findComment-1306512 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. :-\ Link to comment https://forums.phpfreaks.com/topic/254757-image-uploadinginserting-link-into-mysql/#findComment-1306705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.