tags:

views:

95

answers:

3

I have a HTML file and a PHP file in the same folder on the remote server. From the URL, I call the HTML file and the HTML file calls the PHP file when form is submitted.

But it is not going correctly. When I submit the Form, it dislays error:

500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

What is the reason?

Edited:

The source of the PHP file is available [here][1].

The Form tag in the HTML file looks like:

[1]: http://stackoverflow.com/questions/2470088/code-to-send-email-not-workingstrong text

A: 

do you have any .htaccess file???

Syom
A: 

I have a HTML file

this is not relevant

and a PHP file

OK

in the same folder on the remote server.

Not relevant

From the URL, I call the HTML file

This is meaningless gobbedy-gook I presume you mean from the browser you call the URL of the HTML file

and the HTML file calls the PHP file when form is submitted.

No it doesn't. I'm guessing the action of a form in the HTML document is the URL of the PHP script.

But it is not going correctly. When I submit the Form, it dislays error:

500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

PHP as an interpreted language is unlikely to crash and burn - that's not to say it doesn't happen - just that its rare.

Have you checked the PHP script to see if it might be returning the 500 status message?

Is it only this PHP script which dies like this? i.e. do you have other PHP scripts which don't fall over?

What webserver are you using? Is the interpreter running as a module? CGI? Fast CGI?

What happens if you paste the URL of the PHP script directly into your browser?

Did you try google for "PHP" and the error message? (hint: any of the first 10 of the 514000 results all explain when and why this happens).

C.

symcbean
You're splitting hairs. I'd rather have a too detailed description than "my form doesn't work it gives an error".
Pekka
A: 

error 500 means you have an internal error on your code, try to locate the php error log file or the apache error log they will have information that tells you exactly where the error occured

Ronald Conco
or enable php error logging in php.ini
Marcin