Jump to content

salman.pirani

Members
  • Posts

    83
  • Joined

  • Last visited

Posts posted by salman.pirani

  1. below is the code which am executing but its not giving me result, kindly run this whole code at your hand and if it get the result out so kindly share me the whole code instead of sharing changes in one line many thanks ____________________________________________________________________________________________________<?php$allowedExts = array("jpg", "jpeg", "gif", "png");$chunks = explode(".", $_FILES["file"]["name"]);$extension = end($chunks);if (($_FILES["file"]["type"] == "image/gif"|| $_FILES["file"]["type"] == "image/jpeg"|| $_FILES["file"]["type"] == "image/pjpeg")&& $_FILES["file"]["size"] < 20000&& in_array($extension, $allowedExts))if ($_FILES["file"]["error"] > 0)(echo "Return Code: " . $_FILES["file"]["error"] . "<br />";)else(echo "Upload: " . $_FILES["file"]["name"] . "<br />";echo "Type: " . $_FILES["file"]["type"] . "<br />";echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";)if (file_exists("upload/" . $_FILES["file"]["name"]))(echo $_FILES["file"]["name"] . " already exists. ";)else(move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"]);echo "Stored in: " . "upload/" . $_FILES["file"]["name"];)))else(echo "Invalid file";)?>

  2. as per the guidlines gven in that post i have make these changes in code but still its not working_____________________________________________________________________________ <?php$allowedExts = array("jpg", "jpeg", "gif", "png");$chunks = explode(".", $_FILES["file"]["name"]);$extension = end($chunks);if (($_FILES["file"]["type"] == "image/gif"|| $_FILES["file"]["type"] == "image/jpeg"|| $_FILES["file"]["type"] == "image/pjpeg")&& $_FILES["file"]["size"] < 20000&& in_array($extension, $allowedExts))if ($_FILES["file"]["error"] > 0)(echo "Return Code: " . $_FILES["file"]["error"] . "<br />";)else(echo "Upload: " . $_FILES["file"]["name"] . "<br />";echo "Type: " . $_FILES["file"]["type"] . "<br />";echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";)if (file_exists("upload/" . $_FILES["file"]["name"]))(echo $_FILES["file"]["name"] . " already exists. ";)else(move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"]);echo "Stored in: " . "upload/" . $_FILES["file"]["name"];)))else(echo "Invalid file";)?>

  3. in my office PC and some time in my home PC wamp always creates problem and give this error post-98221-0-30618000-1343151369_thumb.gifpost-98221-0-85129400-1343151416_thumb.gif these attached two error have make my life pathetic kindly guide me in this regards and if u can suggest me any other better virtual server so plz let me know thanks

  4. i was trying to have a code from which i can upload the files on server via php and i got this code below from w3school but its not working can u help me with thisthanks_________________________________________________________ <?php$allowedExts = array("jpg", "jpeg", "gif", "png");$extension = end(explode(".", $_FILES["file"]["name"]));if ((($_FILES["file"]["type"] == "image/gif")|| ($_FILES["file"]["type"] == "image/jpeg")|| ($_FILES["file"]["type"] == "image/pjpeg"))&& ($_FILES["file"]["size"] < 20000))&& in_array($extension, $allowedExts)){if ($_FILES["file"]["error"] > 0){echo "Return Code: " . $_FILES["file"]["error"] . "<br />";}else{echo "Upload: " . $_FILES["file"]["name"] . "<br />";echo "Type: " . $_FILES["file"]["type"] . "<br />";echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";if (file_exists("upload/" . $_FILES["file"]["name"])){echo $_FILES["file"]["name"] . " already exists. ";}else{move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"]);echo "Stored in: " . "upload/" . $_FILES["file"]["name"];}}}else{echo "Invalid file";}?>

×
×
  • Create New...