PHP include in HTML File Question
This question is probably really dumb, but how do I get a html file to successfully call a php file?
I know my php file works because when I call it directly www.example.com/example.php it works, but when I put it in a html file using php include('example.php'); ?> it doesn't work. What am I doing wrong?
Thanks
-
Hello, Here's a StackOverflow discussion you may find helpful: MIME Types - Version 70 Documentation - cPanel Documentation Thank you. 0 -
Hello, Here's a StackOverflow discussion you may find helpful: MIME Types - Version 70 Documentation - cPanel Documentation Thank you.
Where can I find the htaccess file or config file?0 -
public_html/.htaccess easy way to achieve rename the all files to php then add RewriteRule ^([^.]+)\.html$ $1.php [L] to your .htaccess Now page.html will be a php page and php will run inside optional we add this addition to our .htaccess RewriteCond %{THE_REQUEST} \ /(.+)\.php RewriteRule ^ /%1.html [L,R=301] it just 301 redirects site.php pages to its html equivalent 0 -
Thank you!!!!!!! It works now!!! 0
Please sign in to leave a comment.
Comments
5 comments