php - Internal 500 error ever time post or get Ajax -


every time try post or use file index.php calls ajax_mysql.php through ajax function post or keep getting internal 500 error. server isnt giving other error that. have included javascript function calls 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 , password if ($username != $username_test) {  //output response  $response = "failed"  echo $response; } ?> 

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

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -