I want to pass the value of the file to catch php using jQuery. Is there a way to pass the value of the file to catch.php, so that var_dump($_FILES) will output somthing?
------ Dizin. Php ------------
<p>Name: <input type="text" name="name" id="name" /></p>
<p>Picture: <input type="file" name="pic" id="pic" />)</p>
<p><a href="#" id="submit" >POST</a></p>
<div id="result"></div>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$("#submit").click(function(){
$.post(
'catch.php',
{name: $('#name').val(), pic: $('#pic').val()},
function(result){
$("#result").html(result);
},
"html"
);
});
</script>
---------- Yakalamak. Php -----------------
<?php
var_dump($_POST);
var_dump($_FILES);
?>