Skip to content
Advertisement

Contact Form, sending an email is just downloading my PHP file

I’m having a weird error that I cannot figure out with a PHP file, I’ve never touched PHP and I am trying to use it to send a Name, Email Address, and a message back to me from a website, but for some reason, the code I wrote is just downloading the PHP file instead, can anyone else see where I may be going wrong here:

HTML

JavaScript

PHP:

JavaScript

Advertisement

Answer

Are you installed a PHP server in your Computer?

If not, download WAMP and try again, you need access the page via http://localhost, and not via file://path_to_document in your web navigator.

Or run the script in a web server.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement