if(isset($_POST['btn_upload']))
{
$filetmp = $_FILES['photo']['tmp_name'];
$filename = $_FILES['photo']['name'];
$filetype = $_FILES['photo']['type'];
$filepath = "photo/".$filename;
move_uploaded_file($filetmp,$filepath);
}
in this code i am getting error as Undefined index: photo
here photo is the name of the input file tag which is in different html file
<div class="form-group">
<label class="col-md-4 control-label">Upload Image</label>
<div class="col-md-4 inputGroupContainer">
<span class="input-group-btn">
<span class="btn btn-default btn-file">
Browse… <input type="file" id="imgInp" name="photo">
</span>
</span>
</div>
<img id='img-upload' />
</div>
so i tried this
$_FILES['photo']=$_POST['photo'];
but then i got error
Illegal string offset 'tmp_name'
Illegal string offset 'name'
Illegal string offset 'type'
please help me out in this.
thanks in advance