Jump to content

500 Internal Server Error


[dx]

Recommended Posts

Hi,I'm have captcha file which uses AJAX to check code. On my PC works fine. Everything Ok. On server. Script sends request to captcha_src.php file, and can't get any response. There are two responses OK, and WRONG. If I go to address/captcha_src?kod=SOME CODE it returns blank white page, not any of those responses, ok or wrong. Also I'm using .htaccess for some links, so could that be a prob?Regards

Link to comment
Share on other sites

If .htaccess is rewriting URLs, there could be a problem, yes. Try renaming .htaccess long enough to test the script, see if anything changes.Since you are sending the script GET data, you can test it from the URL bar in your browser, without using AJAX. Just use a correct ?query string. That should speed up the debugging.Keep in mind that 500 Errors are usually parsing errors.

Link to comment
Share on other sites

Server:Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.5PC:Apache/2.2.11 (Win32) PHP/5.3.0How can we know does 5.2.5 support it

Link to comment
Share on other sites

What would really help is to turn on error reporting while you debug this thing. Or you can include this script in a "frame script" that turns on error reporting. This process has been described many times on the board by JSG and myself.Or just use the online manual to look up functions you're not sure about and see if any of them were added when the version changed.Or you can comment-out lines of your script and eventually find the one that breaks it. This is a standard debugging technique.Are you 100% certain you did not change the script after you uploaded it? As you know, one missing brace or semicolon will keep your script from executing.

Link to comment
Share on other sites

Hi, This is my Script

<?phpsession_start();$kod = $_GET['kod'];if (($kod == $_SESSION["security_code"]) && (!empty($kod)) { 	echo "OK";} else { 	echo "WRONG"; }?>

I don't see any error..

Link to comment
Share on other sites

I think you are missing a closing paren in this line:if (($kod == $_SESSION["security_code"]) && (!empty($kod)) { I tested this by counting the opening parens and comparing that to the number of closing parens. The numbers were not the same.Note: you should really be testing $_GET['kod'] for empty before you do anything else with it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...