Thanks all for your help,
Mark you were correct the stuff that i needed to change was in the http.conf file.
This is what i did just incase there is anyone else out there that has the same problem and can not find the solution. This may not be the best way or the correct way to do this, but it worked for me and did all that i needed it to do so this is what i did:
First off in the http.conf file (in the config dir of your apache webserver) i found the lines that looked like this:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
and i put a # in front of them, which makes them a comment so that means that they do not get excuted/looked at while the config file is being parased.
NOTE: comment out all the lines that have something to do with PHP - we will be adding them somewhere else later.
I then added this little snippet to the http.conf file:
<Directory "/website/apache/htdocs/php">
AllowOverride All
</Directory>
NOTE: Change the "/website/apache/htdocs/php" to the dir that you want PHP to work in.
What this does is makes that php dir able to have the .htaccess file overide settings in the main config file. This will allow us to specify the AddType's that we removed above, just for that php dir. Just incase you are wondering to add that bit of code, i added mine just under the one that looks like:
<Directory "/website/apache/htdocs">
which is where it sets the document root (it should have a comment above it, and your path will probably look different).
Ok, now that is all done there is just one last thing that needs doing before we restart the webserver.
If you go to the directory that you typed in as your php directory, and create a file called .htaccess - if the file already exists just add the lines needed below.
In this file all we need to do is add 2 lines (it could be more if you want, for example if you have both php3 and php4 installed, or there might be other things already in the file). Here we add the lines that we commented out above:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
If there was more that you commented out then add them also, for example you might have:
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php3 .php3
or something like that, but whatever the case, add the ones that you commented out.
Now all that is left is to restart the webserver. Once you have done that, you should be able to only run php files from the php dir (and sub dir's), if there is a php file in any other dir, it will just be displayed as plain text (as in the user will see all the sourece code).
Hope that helps someone out.
If there is any other trouble that people have, please just email me at hurgh@oxley.vic.edu.au
Thanks again Mark for your help also.
-|- Hurgh -|-