Jump to content

NikkiLoveGod

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by NikkiLoveGod

  1. umm? Im not sure what you are trying to do there exactly, but you really shouldnt put stuff into your databasequery without escaping it first with, for example mysql_real_escape_string(). http://fi2.php.net/mysql_real_escape_string And to get that imageuploading to work, you need to put up the ' enctype="multipart/formdata" ' into your <form> tag. then you need to insert a <input type="file" name="image" /> into your form, where you have the textareas. Then you put up to your PHP section and if-statement where it checks if the file is uploaded or not. <?PHP if(!empty($_FILE['image']['name'])) { //NOT EMTPY } ?> and in the not empty part you will put up the checks if the file that is uploaded meets the requirements. and then if it meets the requirements, you move it from the temp file to a some folder in your server. <?PHP //this is the folder where the file is uploaded $uploaddir = 'uploads/'; //This is the actual path to the file. $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); //Check if moving of the file is successfull to the appointed folder if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { //And this states that the action was successfull, here you can insert the LINK to the image into the database. echo "File is valid, and was successfully uploaded.\n"; /* This is an example how you can add it to your database. * * $url = "http://SITEURLHERE.COM/"; * $query = "UPDATE table SET imageurl = '" . $url . $uploadfile . "' WHERE id = '" . $SOMEID . "' "; * $result = mysql_query($query) or die("ERROR!"); * * NOTE: add the escapes and modify to your needs. This should work, though im not a master my self. I havent done this that * many times either */ } else { echo "File uploading failed.\n"; } ?>
  2. Well, first you add a new inputfield into your form, with type="file" and then you put up a code into your php section where you check if the image has been uploaded, and if it has and it meets the requirements, you move it to some folder on your server, and for example, put its link into a database of yours. Check the pdf, there is a simple guide. Remember to put the ENCTYPE="multipart/formdata" into the form, that should help too
  3. It should be possible? There are loads of sites like that. How about you consult your affiliates to put up some script to their site, where the customer makes a successful purchase and after the confirmation, it would send something to your database? With restricted access ofcourse but something like this? or some file that is sent every evening to you. Dont know Just a few ideas Good luck with it!
  4. Hi there! I can recommend this PDF about uploading pictures. It's very simple, but still explains alot of the securityholes in the form and picture itself. I used this one for a project of mine; http://www.scanit.be/uploads/php-file-upload.pdf Good luck! -NikkiLoveGod
×
×
  • 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.