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;
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">
iscriviti!
il tuo nome o pseudonimo:
<textarea rows="1" cols="25" name="nome_user"></textarea>
password:
<textarea rows="1" cols="25" name="password_user"></textarea>
URL da linkare:
<textarea rows="1" cols="25" name="url_user"></textarea>
nuova e-mail:
<textarea rows="1" cols="25" name="email_user"></textarea>
<input type="button" value="iscriviti!" onclick="popola('test.php', document.add_user.nome_user.value);" />
</form>
</td>
</tr>
</table></div>
</body>
</html>