hi i am trying to upload a file with jquery but i am failed
here is my code
[code=html]
<script src=”js/jquery.js” language=”javascript”></script>
<script src=”js/jquery.form.js” language=”javascript”></script>
<script language=”javascript”>
function getResult(){
var encoded=document.getElementById(‘file’).value;
//var encoded=encodeURI(text);
$(document).ready(function() {
$(‘#result_query’).html(‘<p style=”text-align:center;”><img src=”images/ajax-loader.gif” width=”220″ height=”19″ /></p>’);
$(‘#result_query’).load(‘ajax.php?query=’+encoded);
});
}
</script>
<p>
<input name=”file” id=”file” type=”file” onchange=”getResult()” />
</p>
and the php code
[code=php]
$query=$_REQUEST[‘query’];
$query= $_FILES[$query][“name”];
move_uploaded_file($_FILES[“query”][“tmp_name”],”images/” .$query);
when i echo the $queryz with $_REQUEST method variable the variable shown the img name but the $query= $