Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts

    PHP Visible through View Source Export

    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:

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

  • #2
    Regular Coder
    Join Date
    Jul 2005
    Location
    LA, California
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    does your server have php installed?
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    There are 3 kinds of ppl those who can count and those who cant
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Script-Megafest.com Coming Oh so very soon

  • #3
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    This isn't my server, this is any random site online I found usefull information from.

  • #4
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    "$question = ( to() ) ? be() : ~be();"

  • #5
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,058
    Thanks
    10
    Thanked 96 Times in 94 Posts
    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.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #6
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    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?

  • #7
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,058
    Thanks
    10
    Thanked 96 Times in 94 Posts
    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.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #8
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if all the php you see is like this:
    Code:
    <?include("../content/copyright.php");?>
    then I am not surprised, cause to me it looks malformed, shouldn't it be <?php ...
    my mind is on a permanent tangent

  • #9
    Regular Coder
    Join Date
    Feb 2003
    Posts
    345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    php.ini

    Code:
    ; 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

  • #10
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    go to my website and view the source, then tell me what you see....

  • #11
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Rich Pedley
    if all the php you see is like this:
    Code:
    <?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.

  • #12
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    though if shortags are not enabled you will see the unprocessed php.
    my mind is on a permanent tangent

  • #13
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, that is explained in post #9

  • #14
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oops sorry degsy.
    my mind is on a permanent tangent

  • #15
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •