tnesler Posted January 15, 2015 Share Posted January 15, 2015 Hello! I am trying to execute the example form validation form from the PHP tutorial. I copied the complete form to a file called Validate.Html I am using Xampp as my PHP work area. Normally, putting the file in the HtDocs folder and then using localhost to run the file works fine. However, when I try to run this file, I get an error code 403 (Access forbidden). I think this is a problem with a setting in the http.conf file, but I don't know where it is. The htDocs folder has this setting: <Directory "C:/xampp/htdocs"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> Any suggestions on how to fix this? Thanks in advance! Tom Nesler Link to comment Share on other sites More sharing options...
justsomeguy Posted January 15, 2015 Share Posted January 15, 2015 I would check the permissions on all of the files to make sure that Apache has access to read them. Also, if you're trying to run PHP code, you should name it a .php file instead of .html. Link to comment Share on other sites More sharing options...
tnesler Posted January 16, 2015 Author Share Posted January 16, 2015 Thanks for the tips. Changing the file extension fxed everything. I am somewhat confused by the statement "Also, if you're trying to run PHP code, you should name it a .php file instead of .html." I was under the opinion that websites used HTML files with embedded PHP rather than PHP files with HTML statements in them. If this is the case, then even if there is a single line of PHP code, then you use the PHP extension? Thanks for your help! Tom Nesler Link to comment Share on other sites More sharing options...
Ingolme Posted January 16, 2015 Share Posted January 16, 2015 Without the .php extension PHP won't run, at all. No matter how little or how much there is. Link to comment Share on other sites More sharing options...
tnesler Posted January 16, 2015 Author Share Posted January 16, 2015 So, the PHP extension triggers the PHP JIT compiler and the HTML is only read by the browser? That makes sense! Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now