Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Erik Price


On Friday, February 15, 2002, at 01:08  PM, Kevin Stone wrote:

> Thanks for proving the point.  It's like I said.  No one is willing to
> explain what symbolic links are.  -Kevin

Actually, if you inspect the message I sent you (it's quoted below), 
you'll see that the specific part of your original post that I quoted is 
the part about how difficult it is to find information on them, and why 
no one seems to explain them.  I never intended to explain them to you, 
because I thought that someone else on the list had already taken care 
of that.

If you're still curious, the following document explains all about the 
filesystem used on Unix -- and is very readable (not some obscure 
technical document).  Please read it:

http://www.linuxdoc.org/HOWTO/Unix-and-Internet-Fundamentals-
HOWTO/disk-layout.html

This is part of Eric Raymond's "Unix and Internet Fundamentals" How-To 
document.  Even for people who really could care less about Unix, it 
explains pretty much how computers work in general.  I found it very 
informative when I first set about learning everything there is to know 
about computers.

http://www.linuxdoc.org/HOWTO/Unix-and-Internet-Fundamentals-HOWTO/


HTH,


Erik

>> -Original Message-
>> From: Erik Price [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, February 15, 2002 8:41 AM
>> To: Kevin Stone
>> Subject: Re: [PHP] Anyway to open a PHP file and view its code in the
>> browser?
>>
>>
>> On Thursday, February 14, 2002, at 05:44  PM, Kevin Stone wrote:
>>
>>> I did a net wide search on Symbolic links to learn what they are and
> how
>>> to use them.  Wouldn't you know everyone's talking about them but no
> one
>>> explains what they are or how to use them.
>>
>> It's because it's a very common thing in Unix, about as basic as copy
>> and paste is in Windows.  And Unix is the widest-used platform on the
>> web, so a lot of web people are familiar with it.  I'm not sure what
> the
>> Windows equivalent is.
>>
>> HTH,
>>
>>
>> - Erik
>>







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Ashley M. Kirchner

Kevin Stone wrote:

> Thanks for proving the point.  It's like I said.  No one is willing to
> explain what symbolic links are.  -Kevin

I just realized that URL talks about backing up symbolic links, as
opposed to doing an indepth explanation of what they are.  Never the less,
at the top it does say what a symlink is:

"A UNIX symbolic link is a file that contains a pointer to another file
or directory."

One could say, it's like creating a Shortcut on a Win9x (and up)
platform.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Ashley M. Kirchner

Kevin Stone wrote:

> Thanks for proving the point.  It's like I said.  No one is willing to
> explain what symbolic links are.  -Kevin

You just didn't search well enough:

http://pucc.princeton.edu/~clients/symlink.readme

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Kevin Stone

Thanks for proving the point.  It's like I said.  No one is willing to
explain what symbolic links are.  -Kevin

> -Original Message-
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 8:41 AM
> To: Kevin Stone
> Subject: Re: [PHP] Anyway to open a PHP file and view its code in the
> browser?
> 
> 
> On Thursday, February 14, 2002, at 05:44  PM, Kevin Stone wrote:
> 
> > I did a net wide search on Symbolic links to learn what they are and
how
> > to use them.  Wouldn't you know everyone's talking about them but no
one
> > explains what they are or how to use them.
> 
> It's because it's a very common thing in Unix, about as basic as copy
> and paste is in Windows.  And Unix is the widest-used platform on the
> web, so a lot of web people are familiar with it.  I'm not sure what
the
> Windows equivalent is.
> 
> HTH,
> 
> 
> - Erik
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Anas Mughal

If you are on the same machine, why don't you just
open the file as follows:

file:/filename.php

Just don't go thru the webserver.




--- Kevin Stone <[EMAIL PROTECTED]> wrote:
> How can I open a local PHP script and view its code
> to the browser?  The
> Readfile() method appears to parse and execute the
> code.  The Fopen()
> method appears to parse and then not execute the
> code, leaving a blank
> screen, or at the very least displaying any non-PHP
> text existing in the
> script.  This is obviously rare question because I
> can't find any
> references on this list or on Usenet.  Is there a
> trick to this?  Or is
> it simply not possible.
>  
> Much Thanks,
> Kevin Stone <[EMAIL PROTECTED]>
> 


=
Anas Mughal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Tel: 973-249-6665

__
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Christopher William Wesley

Create a script to which you can pass a file namem and calls show_source()
on the file name.

http://www.php.net/manual/en/function.show-source.php

Be very careful to check the input, such that the file name parameter
which eventually gets passed to show_source() cannot be one which you do
not want to be displayed to everyone in the world.

When using the function to show off living code, I make sure the only
files that can be viewed are files in specific directories.  I also make
sure the file exists in the file system ... displaying an appropriate
messages when the file will not be diplayed.

g.luck,
~Chris   /"\
 \ / September 11, 2001
  X  We Are All New Yorkers
 / \ rm -rf /bin/laden

On Thu, 14 Feb 2002, Kevin Stone wrote:

> How can I open a local PHP script and view its code to the browser?  The
> Readfile() method appears to parse and execute the code.  The Fopen()
> method appears to parse and then not execute the code, leaving a blank
> screen, or at the very least displaying any non-PHP text existing in the
> script.  This is obviously rare question because I can't find any
> references on this list or on Usenet.  Is there a trick to this?  Or is
> it simply not possible.
>
> Much Thanks,
> Kevin Stone <[EMAIL PROTECTED]>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Jeff Sheltren

A symbolic link is like a pointer to a file.  It is like a "shortcut" on 
windows OS's...

Jeff

At 03:44 PM 2/14/2002 -0700, Kevin Stone wrote:
>I did a net wide search on Symbolic links to learn what they are and how
>to use them.  Wouldn't you know everyone's talking about them but no one
>explains what they are or how to use them.  So I'm forced to ask...
>
>What are symbolic links?  Why are they useful?  And how do I use them?
>
>--
>Kevin <[EMAIL PROTECTED]>
>
>
> > then do a symbolic link
> >
> > On Thursday 14 February 2002 22:34, Kevin Stone wrote:
> > > I'm glad you posted this.  It's great to know.  Unfortunately it's
>not
> > > what I need to do.  I'm uploading and updating my scripts all the
>time.
> > > So I need to offer code views of *active* scripts.  Changing the
>file
> > > name to phps makes the scripts inactive.
> > >
> > > Any other ideas?
> > >
> > > -Kevin
> > >
> > > > -Original Message-----
> > > > From: SHEETS,JASON (Non-HP-Boise,ex1)
>[mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, February 14, 2002 1:38 PM
> > > > To: 'Kevin Stone'
> > > > Subject: RE: [PHP] Anyway to open a PHP file and view its code in
>the
> > > > browser?
> > > >
> > > > Rename the file you want to display as PHP code to .phps (php
>source)
> > > > instead of .php.
> > > > This will also activate PHP's built in source code highlighting.
> > > >
> > > > Jason
> > > >
> > > > -Original Message-
> > > > From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, February 14, 2002 1:26 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] Anyway to open a PHP file and view its code in the
> > > > browser?
> > > >
> > > >
> > > > How can I open a local PHP script and view its code to the
>browser?
> > >
> > > The
> > >
> > > > Readfile() method appears to parse and execute the code.  The
>Fopen()
> > > > method appears to parse and then not execute the code, leaving a
>blank
> > > > screen, or at the very least displaying any non-PHP text existing
>in
> > >
> > > the
> > >
> > > > script.  This is obviously rare question because I can't find any
> > > > references on this list or on Usenet.  Is there a trick to this?
>Or
> > >
> > > is
> > >
> > > > it simply not possible.
> > > >
> > > > Much Thanks,
> > > > Kevin Stone <[EMAIL PROTECTED]>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Martin Towell

symbolic links are basically pointers to another file/directory

eg. you have a file  foo.html  you can create a symbolic link to it and call
it  bar.html  - if you refer to bar.html, then you're really referring to
foo.html

why are they useful ? well, suppose you want a two or more files/dirs to
have the exact same content (for some reason, since changing one will change
to other) but the content can get quite large, you then use a symbolic link
and you save disk space

on a windows system, i don't think you can (please correct me if I'm wrong
here - i'd like to know if it's possible) but on unix, use the command "ln"

HTH
Martin

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 9:44 AM
To: 'Andreas Gietl'; [EMAIL PROTECTED]
Subject: RE: [PHP] Anyway to open a PHP file and view its code in the
browser?


I did a net wide search on Symbolic links to learn what they are and how
to use them.  Wouldn't you know everyone's talking about them but no one
explains what they are or how to use them.  So I'm forced to ask...

What are symbolic links?  Why are they useful?  And how do I use them?

--
Kevin <[EMAIL PROTECTED]>


> then do a symbolic link
> 
> On Thursday 14 February 2002 22:34, Kevin Stone wrote:
> > I'm glad you posted this.  It's great to know.  Unfortunately it's
not
> > what I need to do.  I'm uploading and updating my scripts all the
time.
> > So I need to offer code views of *active* scripts.  Changing the
file
> > name to phps makes the scripts inactive.
> >
> > Any other ideas?
> >
> > -Kevin
> >
> > > -Original Message-
> > > From: SHEETS,JASON (Non-HP-Boise,ex1)
[mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 14, 2002 1:38 PM
> > > To: 'Kevin Stone'
> > > Subject: RE: [PHP] Anyway to open a PHP file and view its code in
the
> > > browser?
> > >
> > > Rename the file you want to display as PHP code to .phps (php
source)
> > > instead of .php.
> > > This will also activate PHP's built in source code highlighting.
> > >
> > > Jason
> > >
> > > -Original Message-
> > > From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 14, 2002 1:26 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Anyway to open a PHP file and view its code in the
> > > browser?
> > >
> > >
> > > How can I open a local PHP script and view its code to the
browser?
> >
> > The
> >
> > > Readfile() method appears to parse and execute the code.  The
Fopen()
> > > method appears to parse and then not execute the code, leaving a
blank
> > > screen, or at the very least displaying any non-PHP text existing
in
> >
> > the
> >
> > > script.  This is obviously rare question because I can't find any
> > > references on this list or on Usenet.  Is there a trick to this?
Or
> >
> > is
> >
> > > it simply not possible.
> > >
> > > Much Thanks,
> > > Kevin Stone <[EMAIL PROTECTED]>
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Kevin Stone

I did a net wide search on Symbolic links to learn what they are and how
to use them.  Wouldn't you know everyone's talking about them but no one
explains what they are or how to use them.  So I'm forced to ask...

What are symbolic links?  Why are they useful?  And how do I use them?

--
Kevin <[EMAIL PROTECTED]>


> then do a symbolic link
> 
> On Thursday 14 February 2002 22:34, Kevin Stone wrote:
> > I'm glad you posted this.  It's great to know.  Unfortunately it's
not
> > what I need to do.  I'm uploading and updating my scripts all the
time.
> > So I need to offer code views of *active* scripts.  Changing the
file
> > name to phps makes the scripts inactive.
> >
> > Any other ideas?
> >
> > -Kevin
> >
> > > -Original Message-
> > > From: SHEETS,JASON (Non-HP-Boise,ex1)
[mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 14, 2002 1:38 PM
> > > To: 'Kevin Stone'
> > > Subject: RE: [PHP] Anyway to open a PHP file and view its code in
the
> > > browser?
> > >
> > > Rename the file you want to display as PHP code to .phps (php
source)
> > > instead of .php.
> > > This will also activate PHP's built in source code highlighting.
> > >
> > > Jason
> > >
> > > -Original Message-
> > > From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 14, 2002 1:26 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Anyway to open a PHP file and view its code in the
> > > browser?
> > >
> > >
> > > How can I open a local PHP script and view its code to the
browser?
> >
> > The
> >
> > > Readfile() method appears to parse and execute the code.  The
Fopen()
> > > method appears to parse and then not execute the code, leaving a
blank
> > > screen, or at the very least displaying any non-PHP text existing
in
> >
> > the
> >
> > > script.  This is obviously rare question because I can't find any
> > > references on this list or on Usenet.  Is there a trick to this?
Or
> >
> > is
> >
> > > it simply not possible.
> > >
> > > Much Thanks,
> > > Kevin Stone <[EMAIL PROTECTED]>
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Andreas Gietl

then do a symbolic link

On Thursday 14 February 2002 22:34, Kevin Stone wrote:
> I'm glad you posted this.  It's great to know.  Unfortunately it's not
> what I need to do.  I'm uploading and updating my scripts all the time.
> So I need to offer code views of *active* scripts.  Changing the file
> name to phps makes the scripts inactive.
>
> Any other ideas?
>
> -Kevin
>
> > -Original Message-
> > From: SHEETS,JASON (Non-HP-Boise,ex1) [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 14, 2002 1:38 PM
> > To: 'Kevin Stone'
> > Subject: RE: [PHP] Anyway to open a PHP file and view its code in the
> > browser?
> >
> > Rename the file you want to display as PHP code to .phps (php source)
> > instead of .php.
> > This will also activate PHP's built in source code highlighting.
> >
> > Jason
> >
> > -Original Message-
> > From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 14, 2002 1:26 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Anyway to open a PHP file and view its code in the
> > browser?
> >
> >
> > How can I open a local PHP script and view its code to the browser?
>
> The
>
> > Readfile() method appears to parse and execute the code.  The Fopen()
> > method appears to parse and then not execute the code, leaving a blank
> > screen, or at the very least displaying any non-PHP text existing in
>
> the
>
> > script.  This is obviously rare question because I can't find any
> > references on this list or on Usenet.  Is there a trick to this?  Or
>
> is
>
> > it simply not possible.
> >
> > Much Thanks,
> > Kevin Stone <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Kevin Stone

I'm glad you posted this.  It's great to know.  Unfortunately it's not
what I need to do.  I'm uploading and updating my scripts all the time.
So I need to offer code views of *active* scripts.  Changing the file
name to phps makes the scripts inactive.

Any other ideas?

-Kevin

> -Original Message-
> From: SHEETS,JASON (Non-HP-Boise,ex1) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 14, 2002 1:38 PM
> To: 'Kevin Stone'
> Subject: RE: [PHP] Anyway to open a PHP file and view its code in the
> browser?
> 
> Rename the file you want to display as PHP code to .phps (php source)
> instead of .php.
> This will also activate PHP's built in source code highlighting.
> 
> Jason
> 
> -Original Message-
> From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 14, 2002 1:26 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Anyway to open a PHP file and view its code in the
> browser?
> 
> 
> How can I open a local PHP script and view its code to the browser?
The
> Readfile() method appears to parse and execute the code.  The Fopen()
> method appears to parse and then not execute the code, leaving a blank
> screen, or at the very least displaying any non-PHP text existing in
the
> script.  This is obviously rare question because I can't find any
> references on this list or on Usenet.  Is there a trick to this?  Or
is
> it simply not possible.
> 
> Much Thanks,
> Kevin Stone <[EMAIL PROTECTED]>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Erik Price



On Thursday, February 14, 2002, at 03:26  PM, Kevin Stone wrote:

> How can I open a local PHP script and view its code to the browser?  The
> Readfile() method appears to parse and execute the code.  The Fopen()
> method appears to parse and then not execute the code, leaving a blank
> screen, or at the very least displaying any non-PHP text existing in the
> script.  This is obviously rare question because I can't find any
> references on this list or on Usenet.  Is there a trick to this?  Or is
> it simply not possible.
>

This is just a guess, but have you tried this?

$text = "/* ";
$text .= readfile($fp);
$text .= " */";

To comment the code?

Just a guess.  (And it would result in nested comments, not sure if that 
is a no-no for the parser or not).


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php