Jump to content

salman.pirani

Members
  • Posts

    83
  • Joined

  • Last visited

Everything posted by salman.pirani

  1. actually i was trying to say that every time i make changes i never work any doing change in few line again and again making me confuse so could you let me know the finall whole code that works so i will be very thank full to you.
  2. 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"?>
  3. its still giving this error Parse error: parse error in C:\wamp\www\upload\upload_file.php on line 25
  4. Parse error: parse error in C:\wamp\www\forum\upload_file.php on line 17 its giving this error
  5. 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"?>
  6. in my office PC and some time in my home PC wamp always creates problem and give this error 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
  7. 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...