TheDoctorLewis Posted October 10, 2015 Share Posted October 10, 2015 I am using a PHP contact form and am using iframe to link to my html webpage but when I do it just shows the php code, like so: Quote Link to comment Share on other sites More sharing options...
benanamen Posted October 10, 2015 Share Posted October 10, 2015 (edited) Does the name of the actual file with the Php code have a .php extension? If so, does it do the same thing when you view that file directly? Additionally, are you viewing this file through a web server local or otherwise? Edited October 10, 2015 by benanamen Quote Link to comment Share on other sites More sharing options...
TheDoctorLewis Posted October 10, 2015 Author Share Posted October 10, 2015 Does the name of the actual file with the Php code have a .php extension? If so, does it do the same thing when you view that file directly? Additionally, are you viewing this file through a web server local or otherwise? Here is the picture of the file directory and yes when I try and open the PHP file in google chrome it just shows me code.... Quote Link to comment Share on other sites More sharing options...
Solution hyster Posted October 10, 2015 Solution Share Posted October 10, 2015 (edited) u have to run a .php file from inside a webserver not from ur pc (unless u have a web server installed on ur pc) Edited October 10, 2015 by hyster Quote Link to comment Share on other sites More sharing options...
TheDoctorLewis Posted October 10, 2015 Author Share Posted October 10, 2015 u have to run a .php from a webserver not from ur pc (unless u have a web server installed on ur pc) So if I upload the files to the FTP and use it through my hosting company it should work? Quote Link to comment Share on other sites More sharing options...
hyster Posted October 10, 2015 Share Posted October 10, 2015 without looking at the code yes, php needs to be interpreted before it can be displayed in a browser as html code. a html file is already html so can be opened directly in a browser Quote Link to comment Share on other sites More sharing options...
benanamen Posted October 10, 2015 Share Posted October 10, 2015 I suggest you install a local development server. There is xampp and wamp for starters. I don't use either one (I use Zend Server) so I couldn't tell you what to choose. I am sure others will be able to recommend one over the other Quote Link to comment Share on other sites More sharing options...
TheDoctorLewis Posted October 10, 2015 Author Share Posted October 10, 2015 I suggest you install a local development server. There is xampp and wamp for starters. I don't use either one (I use Zend Server) so I couldn't tell you what to choose. I am sure others will be able to recommend one over the other I have got it working now, the local hosting was the problem (sorry guys didn't know) thanks for all of the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.