You are here: Re: CLI ( command-line ) PHP displaying source code in-line when program is executed « PHP Programming Language « IT news, forums, messages
Re: CLI ( command-line ) PHP displaying source code in-line when program is executed

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация