tim@getdim Posted May 11, 2012 Share Posted May 11, 2012 Hello all, i have a feeling im doing something wrong, but i have no idea what. being server-side code, php should not show when you 'view page source' in your browser (or rather it should display as html), correct ? why, then am i seeing php code when i view page source? see attached image Quote Link to comment https://forums.phpfreaks.com/topic/262420-why-am-i-seeing-php-when-i-view-the-source-code-of-the-page/ Share on other sites More sharing options...
Jessica Posted May 11, 2012 Share Posted May 11, 2012 There could be several reasons. Maybe the page is saved as a .html, maybe the server doesn't have PHP installed, maybe you echo'd that line in your script. Can you post the section of code that produces it? Quote Link to comment https://forums.phpfreaks.com/topic/262420-why-am-i-seeing-php-when-i-view-the-source-code-of-the-page/#findComment-1344864 Share on other sites More sharing options...
wigwambam Posted May 11, 2012 Share Posted May 11, 2012 Create a file called test.php Enter the following code: <?php phpinfo(); ?> Access test.php in your browser, what do you see? Quote Link to comment https://forums.phpfreaks.com/topic/262420-why-am-i-seeing-php-when-i-view-the-source-code-of-the-page/#findComment-1344871 Share on other sites More sharing options...
batwimp Posted May 11, 2012 Share Posted May 11, 2012 And once you do get it running, stick a semi-colon at the end of your include statement there... Quote Link to comment https://forums.phpfreaks.com/topic/262420-why-am-i-seeing-php-when-i-view-the-source-code-of-the-page/#findComment-1344872 Share on other sites More sharing options...
Pikachu2000 Posted May 12, 2012 Share Posted May 12, 2012 A line terminating semicolon isn't needed immediately before a closing ?> tag. Quote Link to comment https://forums.phpfreaks.com/topic/262420-why-am-i-seeing-php-when-i-view-the-source-code-of-the-page/#findComment-1344902 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.