Image upload Html form: <html> <body> <form action="uplo.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> HTML: Image upload code: <?php if ((($_FILES["file"]["type"] == "image/bmp")|| ($_FILES["file"]["type"] == "image/gif")|| ($_FILES["file"]["type"] == "image/jpg"))&& ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . " "; } else { echo "Upload: " . $_FILES["file"]["name"] . " "; echo "Type: " . $_FILES["file"]["type"] . " "; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb "; echo "Temp file: " . $_FILES["file"]["tmp_name"] . " "; if (file_exists("c:/e/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_… "c:/e/" . $_FILES["file"]["name"]); echo "Stored in: " . "c:/e/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } ?> PHP: Now i need a script which would retrieve the "Uploaded" image link from IMAGESHACK.US trying a wordpress plugin using this.. can someone help me out ! thanks.
An input with type="file" allows your user to choose a file to upload to your server. Since the file is already on your server, there's no need to "retrieve" it. This method won't allow your user to point to an image hosted on Image Shack and allow you to download it to your site (which would be illegal if your user doesn't own the image).