Internal 500 error ever time post or get Ajax

Every time I try to post or use get from my file index.php which calls Ajax_mysql.php through the Ajax function POST or GET I keep getting a Internal 500 error. The server isnt giving any other error than that. I have included my javascript function that calls the serverside php.

function submit_login() {
    if( document.form.loggedIn.checked ) return
    request = new XMLHttpRequest()
    request.onreadystatechange = respond_login
    request.open("POST", "Ajax_mysql.php", true)
    request.send( "action=login&password=" + postEscape( document.form.pwd.value ) +
                    "&username=" + postEscape( document.form.user.value ))
    document.form.pwd.value = ""
    document.form.user.value = ""
}

Php Ajax_mysql.php:

<?php
$password_test = "fcb";
$username_test = "ben";
$action = $_POST['action'];
$username = $_POST['username'];
$password = $_POST['password'];
//Testing against hardcoded username and password
if ($username != $username_test)
{
 //output the response
 $response = "failed"
 echo $response;
}
?>

Answers


 $responce = "failed"   //miss ;
echo $response;       // typo $responce; 

Need Your Help

Detect a broken link (web) in perl

perl lwp broken-links

I'm trying to detect if a link is broken or not, as in if it's a web address I could paste into my browser and find a web page. I've tried two methods so far that I found online and both are giving...

Publish multiple websites together

visual-studio-2012

We have a solution which contains about 12 web apps which need to be published together.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.