After pressing the submit button, I see the PHP code in the browser

Problem:

When you press "submit" on the HTML form, the browser shows a bunch of the php stuff instead of "success" or "error" page.

Solutions:

The most common reason for this problem is that your web server does not have PHP installed.

However, there are 2 other possible reasons for this behavior:

1) Your PHP script requires a specific file extension (.php or .php4 or .phtml) so the web server knows it must process the file with PHP before sending it to the user's browser. Ask your web hosting provider if you require a specific file extension.

2) Your web server is restricted to run PHP scripts in a specific directory for security reasons. Ask your web hosting provider for a possible restriction.