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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.