<?
if (isset($_POST['szoveg'])) {
header('Content-Type: text/javascript; charset=utf-8');
die('<h1>'.sha1(microtime()).'</h1>');
}
header('Content-Type: text/html; charset=utf-8')?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="jquery.form.js"></script>
<script type="text/javascript">
function Upload() {
$('#ezaform').ajaxSubmit({
success: function(eredmeny) {
alert(eredmeny);
$('#ide').html(eredmeny);
}
});
}
</script>
</head>
<body>
<form id="ezaform" method="post" action="<?=$_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
<p><input type="text" name="szoveg" value="123456"/></p>
<p><input type="file" name="cucc"/></p>
<p><input type="button" value="Upload!" onclick="Upload()"/></p>
</form>
<p id="ide"></p>
<p><?highlight_file(__FILE__)?></p>
</body>
</html>