sorry about my english. I have a problem with AJAX about one week, and can't solve it. I have Searched everywere. This is part of code of login.js function. I don't know why it don't work
..
connect.open("POST","ajax.php?mode=login",true);
connect.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
window.alert(form); //here I see the window,with the data form ok
connect.send(form);
...
The path of ajax.php it's right, I put a message at the begining of ajax.php to check, but never execute.
ajax.php code...
<?php
if($_POST)
{
switch (isset($_GET['mode']) ? $_GET['mode'] : null)
{
case 'login':
echo "login case";
break;
default:
header('location: index.php');
break;
}
}
else
{
header('location: index.php');
}
?>
Thanks in advance...