if you run index.html below , the output is Array ( [nama] => tumin [address] => jakarta ) without pic is included on it while the form contain ‘pic’ with type=‘file’.
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
function sendit(formobj,url,respon)
{
$.ajax({
url:url,
beforeSend: function()
{
$(respon).html('before sending');
},
data:$(formobj).serialize(),
type:"post",
dataType:"html",
success: function(msg)
{
$(respon).html(msg);
},
});
return false;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form method="" enctype="multipart/form-data" id="frm" action="">
Name : <input type="text" name="nama" name="nm" /><br />
Address : <input type="text" name="address" name="addres" /><br />
Picture : <input type="file" name="pic" name="nm" /><br />
<input type="button" name="btn" value="Send"
onclick="sendit('#frm','save.php','#dom_ajax');" />
</form>
<div id="dom_ajax"></div>
</body>
</html>
save.php
<?php
$arr=$_POST;
print_r($arr);
?>