...

View Full Version : PHP Visible through View Source Export



Element
01-12-2006, 03:25 AM
This might be interesting. Its not much of help, but in a way is because you obviously don't want this happening.

Browser: Juno 5.0
Text Viewer: notepad.exe

I just noticed about ten minutes ago while going through all my page sources saved into a folder.... all the PHP is visible! Whenever someone uses the php tags <? ?> the PHP is visible too me in my source. I was wondering if it might be the way Juno is getting the file, or does this happen too you (anyone) too?

Example:



<p>
<?include("../content/copyright.php");?></center><br>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</body>
</html>

Al_90
01-12-2006, 04:00 AM
does your server have php installed?

Element
01-12-2006, 04:34 AM
This isn't my server, this is any random site online I found usefull information from.

Velox Letum
01-12-2006, 05:42 AM
It shouldn't display. All PHP code is executed before any output is sent, unless the output buffer is flushed, but even then the PHP should have been executed first.

firepages
01-12-2006, 06:52 AM
It's got nothing to do with the browser if thats what you are asking , the pages you are looking at are either not php files or the server they are hosted on does not have php installed or is badly configured.

Element
01-12-2006, 08:33 AM
Hmm, well all I know, like if I go to the page thats on, the PHP is executed, the copyright is there, the file is .php and everything, but the PHP is visible. Is it possible some configuration allows the PHP code to be outputted to the users cache page?

firepages
01-12-2006, 08:54 AM
Is it possible some configuration allows the PHP code to be outputted to the users cache page?

not unless thats what the author intended in say a highlight_file() operation or similarin other words only if thats what they meant to happen (excluding the possibility of a misconfigured installation which would mean that the PHP component of the page would not work anyway)

go to any php web pages out there (including this forum) and tell us the php source ... you can't no matter what browser you use.

Rich Pedley
01-12-2006, 09:56 AM
if all the php you see is like this:
<?include("../content/copyright.php");?>then I am not surprised, cause to me it looks malformed, shouldn't it be <?php ...

maltrecho
01-12-2006, 12:22 PM
php.ini


; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On

NancyJ
01-12-2006, 12:29 PM
go to my website and view the source, then tell me what you see....

degsy
01-12-2006, 01:50 PM
if all the php you see is like this:
<?include("../content/copyright.php");?>then I am not surprised, cause to me it looks malformed, shouldn't it be <?php ...

You can use it like the description above states, but it is malformed.
A space is required between the <? and the include text/function.

Rich Pedley
01-12-2006, 02:49 PM
though if shortags are not enabled you will see the unprocessed php.

degsy
01-12-2006, 02:56 PM
Yes, that is explained in post #9

Rich Pedley
01-13-2006, 10:24 AM
oops sorry degsy.

Element
01-13-2006, 10:31 AM
Aha, so it must just be these websites then. I really can't tell if anything else would be PHP because if it is, and is executed correctly it shouldn't be visible like we all know. So it must just be when they don't use spaces, and so whatever it is that excludes PHP sources from the clients document misses it. Not pretending I know whatever this 'php-masking-thing' does, just an vague assumption based on facts present.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum