Re: showsource
| From: | Monte Ohrt | Date: | Wed, 01 Nov 2000 21:04:35 +0000 |
| Subject: | Re: showsource | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-23242@lists.php.net to get a copy of this message | ||
Just beware, that may be a bit dangerous for public use:
showsourcescript.php?script=%2Fetc%2fpasswd
Be sure to put in appropriate security checks, or just put the code
in the script itself, and use $SCRIPT_FILENAME for the path.
Ron Robertson wrote:
>
> "Bart A. Verbeek" wrote:
>
> > Hello,
> >
> > Is there a function (or something) in PHP to show the source off a script?
> > I mean like: file.php3?showsource
> >
> > And then it pops up with the source of the script?
> >
> > thanks
> > Bart
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> Well you can write a script with this:
> show_source($script);
> or, highlight_file($script);
>
> and then pass the $script name like this:
> showsourcescript.php?script=myscriptname
>
> -r-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/