Hi I am not able to get PHP FILES values in view.php
, whereas normally it is found in view.php
. Please help me out. Thanks in advance.
Here is my code:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<title>Untitled Document</title>
<script type="text/javascript">
$( document ).ready(function() {
$('#uploadBtn').click(function() {
$.ajax( {
type: 'POST',
contentType:attr( "enctype", "multipart/form-data" ),
url: 'view.php',
data: $('myform').serialize() ,
success: function(data){
alert(data);
}
});
});
});
</script>
</head>
<body>
<form enctype="multipart/form-data" method="post" action="view.php" name="myform">
<input id="f" type="file" value="" name="myfile"/>
<input type="button" value="try" id="uploadBtn" />
</form>
</body>
</html>