a sto punto mi sa che sto facendo qualche errore banalissimo... cmq:
file form.php
Codice PHP:
<html>
<head>
...cut...
</head>
<body>
<div id="content">
<form action="anteprima.php" method="post">
...cut...
[url="#"]prova[/url]
...cut...
</form>
</div>
</body>
</html>
file script.js
Codice PHP:
var url = "./visualizza_immagini.php";
function sendPath(path){
if (httpSetImages.readyState == 4 || httpSetImages.readyState == 0){
param = 'path=' + path;
httpSetImages.open('POST', url, true);
httpSetImages.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
//httpSetImages.setRequestHeader('Connection','close');
httpSetImages.onreadystatechange = handleHttpSetImages;
httpSetImages.send(param);
}
}
//initiates the XMLHttpRequest object
//as found here: [url]http://www.webpasties.com/xmlHttpRequest[/url]
function getHTTPObject(){
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try{
xmlhttp = new XMLHttpRequest();
} catch (e){
xmlhttp = false;
}
}
return xmlhttp;
}
var httpSetImages = getHTTPObject();
file visualizza_immagini.php:
Codice PHP:
<?php
print_r($_POST);
print_r($_GET);
print_r($_REQUEST);