Posted by Jasen Betts on 02/12/06 21:31
On 2006-02-12, Double Echo <doubleecho@your.com> wrote:
> Hi all,
>
> I'm using PHP 4.4.2, and use PHP on both the command-line and the web.
> When I run the following program from the command line it prints out the
> source code as well as the output from the program. I run other PHP programs
> on the command-line and this doesn't happen. It's really peculiar. The
> error output is below.
>
>
> 1 fields in line 1:<br>
><?php<br>
> 1 fields in line 2:<br>
><br>
> 1 fields in line 3:<br>
> if ( $argv[0] )<br>
> 1 fields in line 4:<br>
> {<br>
> 1 fields in line 5:<br>
> $file = $argv[0] ;<br>
.....
><?php
>
> if ( $argv[0] )
> {
> $file = $argv[0] ;
> }
> else {
> $file = $_GET['file'] ;
> print "<font face=arial>\n" ;
> }
argv[0] is the name of the PHP script.
your program is reading itself and printing itself out.
use argv[1];
--
Bye.
Jasen
[Back to original message]
|