1

I've looked online however I can't seem to get my head around this problem.Below is the screenshot of the code which is showing. I have Apache and MySQL running. Any help would be amazing!

Below is my code for the form.

Name: <input type = "text" name = "Full Name">
MobileNumber: <input type = "interger" name = "Mobile Number">
Email: <input type = "text" name = "Email">
Address: <input type = "text" name = "Address">
PostCode: <input type = "text" name = "Post Code">
Interests: <input type = "text" name = "Interests">
<input type = "submit" value = "Enter">
</form>
Donald Duck
  • 7,638
  • 19
  • 69
  • 90
dave
  • 13
  • 3
  • In your screen shot, the page is being served up locally by your *client* computer, which I would expect is not running Apache, and therefore it is not processing the PHP code. – Jonathan M Feb 28 '17 at 17:07
  • it is a php code u need to run it in a server like wamp server – Sugumar Venkatesan Feb 28 '17 at 17:07
  • To make this work you'll need to load this file onto a web server with PHP installed. – Jonathan M Feb 28 '17 at 17:08
  • Possible duplicate of [PHP code is not being executed, instead code shows on the page](http://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-instead-code-shows-on-the-page) – user3942918 Feb 28 '17 at 17:11

1 Answers1

2

Your solution is simple.

You can't run directly PHP as a file. You have tu run it via your localhost (assuming you have PHP installed)

Locate where your "public_html" o "web" or "www" folder is. And that is where you should put/move your PHP files.

After you move your file to the appropriate web folder, you can run it like this:

http://localhost/datanew.php

http://127.0.01/datanew.php

NOTE: when you call a PHP file outside a server environment, you are simply showing the content of your file. But if you call the file through a web server, then web server runs the PHP scripts and outputs the results of your PHP script.

docliving
  • 111
  • 1
  • 6