caricamento ricorsivo (più o meno)

alladr

Nuovo Utente
29 Apr 2009
1
0
0
ciao a tutti.
dunque, ho un div con un modulo che vorrei inviasse le proprie variabili a se stesso (smepre dentro il div). ho scritto questa pagina ma non ho idea del perché non funzioni. qualcuno sa aiutrarmi?
grazie mille!

#########################################

<html>
<head>
<title>test</title>
</head>
<body>

<?php
$cip = $_POST[funzione];
print $cip;
$nome = $_GET[nome_user];
$password = $_POST[password_user];
$email = $_POST[email_user];

echo "$nome $password $email";
?>

<div id="azioni" style="position: relative; float: left; width: 25%; height: 400px; overflow: scroll; background-color: #fafafa; border-style: none; padding: 5px; z-index:2;">

<script language="javaScript">
var myRequest = null;

// questo codice ￾ pedestremente copiato da: http://antirez.com/articoli/spaghettiajax.html
function CreateXmlHttpReq(handler) {
var xmlhttp = null;
try {
xmlhttp = new XMLHttpRequest();
} catch(e) {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
xmlhttp.onreadystatechange = handler;
return xmlhttp;
}


function myHandler(){
if(myRequest.readyState == 4 && myRequest.status == 200){
var txt = document.getElementById("azioni");
txt.innerHTML = myRequest.responseText;
}
else{
txt.innerHTML = myRequest.status, " ", myRequest.readyState;
}
}

function popola(x, y) {
var page = x;
var rand = escape(Math.random());
myRequest = CreateXmlHttpReq(myHandler);
myRequest.open("POST",page,true);
myRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded ISO-8859-1");
var dati = "nome_user="+y;
alert(dati);
myRequest.send(dati);
}

</script>

<table border="0" cellspacing="5" width="100%">
<tr>
<td align="left" valign="top" bgcolor="#fafad9">
<form method="post" name="add_user">
<input type="hidden" name="funzione" value="aggiungi_utente">
<b> iscriviti!</b><br/><br/>il tuo nome o pseudonimo:
<br/><textarea rows="1" cols="25" name="nome_user"></textarea><br/>

password: <br/> <textarea rows="1" cols="25" name="password_user"></textarea>
<br/>
URL da linkare:<br/>
<textarea rows="1" cols="25" name="url_user"></textarea>
<br/> nuova e-mail: <br/>

<textarea rows="1" cols="25" name="email_user"></textarea><br/>
<input type="button" value="iscriviti!" onclick="popola('test.php', document.add_user.nome_user.value);" />
</form>
</td>
</tr>
</table></div>
</body>
</html>
 

Discussioni simili