How to display PHP without running script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Gray

    How to display PHP without running script

    Hi,

    I have a page that basically just displays a directory listing of gif
    files (along with displaying the file)..

    In case you were wondering, they are avatars for a message board...

    I want to be able to show visitors the php code if they want to do the
    same thing. Its there a way to do this besides copying the file and
    making it a text file?

    Before you ask, I dont have any passwords or such listed in there...
  • Pedro Graca

    #2
    Re: How to display PHP without running script

    Mark Gray wrote:[color=blue]
    > I want to be able to show visitors the php code if they want to do the
    > same thing. Its there a way to do this besides copying the file and
    > making it a text file?[/color]


    Copy it to iconpage.phps (or make a symbolic link) and go to


    NB: The web server must be properly configured to handle phps files.



    Or you can use the highlight_file( ) function.
    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.




    All the pages on the PHP site have a "Show source" link at the bottom.
    You can copy the way they did it.
    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


    --
    USENET would be a better place if everybody read: : mail address :
    http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
    http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
    http://www.expita.com/nomime.html : to 10K bytes :

    Comment

    • Tim Van Wassenhove

      #3
      Re: How to display PHP without running script

      In article <e9a43514.04050 70414.5842a344@ posting.google. com>, Mark Gray wrote:[color=blue]
      > I have a page that basically just displays a directory listing of gif
      > files (along with displaying the file)..
      > http://gummibearheads.com/ign/icons/iconpage.php
      > In case you were wondering, they are avatars for a message board...
      >
      > I want to be able to show visitors the php code if they want to do the
      > same thing. Its there a way to do this besides copying the file and
      > making it a text file?[/color]

      viewsource.php

      <?php readfile('iconp age.php'); ?>

      --

      Comment

      • Chung Leong

        #4
        Re: How to display PHP without running script

        "Mark Gray" <peeweejd@yahoo .com> wrote in message
        news:e9a43514.0 405070414.5842a 344@posting.goo gle.com...[color=blue]
        > Hi,
        >
        > I have a page that basically just displays a directory listing of gif
        > files (along with displaying the file)..
        > http://gummibearheads.com/ign/icons/iconpage.php
        > In case you were wondering, they are avatars for a message board...
        >
        > I want to be able to show visitors the php code if they want to do the
        > same thing. Its there a way to do this besides copying the file and
        > making it a text file?
        >
        > Before you ask, I dont have any passwords or such listed in there...[/color]

        show_source($fi lename);


        Comment

        Working...