Ragazzi,
ho seguito un tutorial e ho fatto un semplice script che stampa in un alert cio che scrivo in due caselle di testo... ecco il codice:
<?
if (($_POST['userid'])&& ($_POST['passw']))
{
echo $_POST['userid'];
exit();
}
else
{
?>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
$(document).ready(function()
{
$("cmdok").click(function()
{
$.post
(
"barra_nuova.php",
{userid: $("userid"), passw: $("passw")},
function(risposta)
{
//$("databarra").value = risposta;
alert(risposta);
}
);
});
});
</script>
</head>
<body>
<table border="0" width="1010" align="center" cellpadding="0" style="border-collapse: collapse">
<tr>
<td valign="top">
<div id="databarra">
<table border="0" width="413">
<tr>
<td width="85">
<p align="right">User: </td>
<td width="108">
<p align="right">
<input type="text" name="userid" id="userid" size="20"></td>
<td width="63">Password: </td>
<td width="108"><input type="text" name="passw" id="passw"></td>
<td colspan="2" width="27"><input type="button" name="cmdok" id="cmdok" value="ok"> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
<?
}
?>
Ma non mi si fila proprio quando premo OK dopo la compilazione..
Dove sbaglio?