Jump to content

Php form not submitting just showing code


Caf26

Recommended Posts

I am new to php and want to add a form to my site to send am email to the owner on completion of the form, I have got the code but when I try to run it in chrome (through notepad++) I click submit but it show the php code rather than sending an email, is this a problem with the code or because it's not on a server and just tan through notepads run in chrome function

You'll need a web server with PHP installed, and access the page via it.

PHP is a server-side scripting language, which means that it needs to be run on the server, before any content is sent to the client. Browsers does not understand PHP code, only HTML, CSS and JS. Which is why it's only showing you the code, as if the file was a pure text file (which it is, as far as the browser is concerned).

 

For Windows you can download WAMP, which will install everything you need in one go. After you've done that, just move the files to the document root of the web server (htdocs), and then open the page via "localhost" in the browser.

I downloaded wamp and that has sorted the problem with showing the code, my form is fully functional apart from actually receiving the emails, I beta confirmation on screen saying Thankyou for submitting but do not receive the email, is this because its ran through wamp?

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.