Witam mam taki problem, napisałem skrypt w ajax'sie
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('#button').click(function() {
$.ajax({
url : '<?php echo 'http://'.$_SERVER['HTTP_HOST'].'/app/portal/register' ?>',
data: 'n=2&k=3',
type: 'POST',
success: function(data) {
alert(n);
}
});
});
});
</script>
formularz html
<form action="#" method="post" id="register">
<table cellspacing="0">
<tr>
<td>Name</td>
<td><input type="text" name="name" id="name" value="" /></td>
</tr>
<tr>
<td></td>
<td><input type="button" value="Register" id="button"/></td>
</tr>
</table>
</form>
W tym samym pliku mam linijkę sprawdzającą tablicę POST:
<?php var_dump($_POST); ?>
Dodam jeszcze, że dostaję błąd JS: Błąd: n is not defined
Plik źródłowy: http://localhost/app/portal/register
Wiersz: 13