Featured Posts

Facebook Connect Facebook Connect ဘယ္လိုလုပ္မလဲ။ အရင္ဆံုး api key ရရိွေအာင္ register လုပ္ဖုိ႕ လိုအပ္ပါတယ္။ http://developers.facebook.com/connect.php မွာ...

Readmore

Read Json with Jquery Jquery မွာ json ဘယ္လို ဖတ္ရမလဲဆိုတာကို ေရးျပထားပါတယ္။ ဒီ code ကို မဖတ္ခင္ json ဆိုတာ ဘာလဲဆိုတာကိုေတာ့...

Readmore

AntiUsbHidden 1.1 အခု version မွာ autorun.inf ကိုပါ ဖ်က္ထားတယ္။ ေနာက္ျပီး coding ပိုင္းကို သပ္သပ္ရပ္ရပ္ျဖစ္ေအာင္...

Readmore

Antiusb Hidden (GUI) Antiusb Hidden ကို console နဲ႕ေရးထားျပီး အခု version က GUI နဲ႕လုပ္ထားပါတယ္။ Drive List ကို ထုတ္ထားတဲ့အဆင့္...

Readmore

Programming ေလ့လာရာဝယ္ ကိုသာသာ ေရးထားတာေလးကို အျခား programmer ေတြ developer ေတြ programming ကို ေလ့လာေနသူေတြ ဖတ္သင့္တယ္ထင္လုိ႕...

Readmore

  • Prev
  • Next

Upload with PHP

Posted on : 07-09-2009 | By : saturngod | In : PHP

Tags:

0

sample.html

<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>

upload.php

<?php
  $target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
  echo "The file ".  basename( $_FILES['uploadedfile']['name']). " has been uploaded";
  } else{
  echo "There was an error uploading the file, please try again!";
  }
  ?>

Related Post

  • No Related Post

Write a comment