MAMP php files



I am currently using MAMP for my php scripts, but I’m having a problem getting them to load in my browser.

I same the php scripts as filename.php in the htdocs folder. When I directly load these in the webrowser the pages load.

My problem is when I run a html doc that sends data to a php page using the action attribute. For example, I have a html script that has a form in it. The form tag will say:

Now when I complete the form and click submit the browser will go to the php page. However, the php code is not executed, and appears as code on the page.

Both the html and php are saved to htdocs.

How do I remedy this problem? Thank you.



You can start by posting your code.


And which urls you access your site with. If you access them directly (c:\somewhere\file.php) they should not work as you’re not going through the web server. It may sound like this is the case, as HTML files will render correctly since they need no server processing.


First problem is you have no values for your drop downs.


if you do an index.php page with just this,

[php]<?php phpinfo();[/php]

What does it show?


This is wrong

And you have no semicolon here

$total = $total * $taxrate


While it is true that there are several errors in the code, it doesn’t fill in why the php is not parsing.