Mike,

I've run into similar concerns while debugging my own php code; I'm
relatively new to php, so can't offer much help as to 'what changed as of
which version', but...

One thing I have run into already while debugging: php parses the _entire_
script before attempting to execute it.  So, as I understand it,
'traditional' methods of passing an 'echo' command, for example, to see how
far the program has 'stepped' may give you misleading results (as in no
results at all!)

I _would_ suggest you turn on all the debug message options in your php.ini
file while trying to sort this out, though...

Please let me know how you sort this out - I am running into errors, too,
with a similar - very simple - if/else construct.

Lou

> Hello.
> I've installed 4.2.3 on Apache 1.3.26 running on an Sun Ultra 1 with Solaris
> 9.
> 
> I have a script I wrote a while back that has worked fine on PHP 4.0.5 on my
> current server. The script displays images on a web page. I build a pop-up
> list of all the images in the current directory and have a "show" button
> which sends a url thusly:
> 
> http://vortac.aviate.org/53sf/show.php?thePhoto=photo1.jpg
> 
> The script starts by checking whether the argument exists, then passes the
> name of the photo for processing:
> 
> if( $thePhoto ) {
>       LoadImageData();
>       DisplayPhoto( "$thePhoto" );
>   } else {
>       LoadImageData();
> 
>       if( count($photos) > 0 ) {
>           DisplayPhoto( "$photos[0]" );
>       } else {
>           PrintError( "Viewer error! can't load photos." );
>       }
>   }
> 
> This works fine on 4.0.5, but is broken on 4.2.3! I can't seem to figure out
> what is going on. I threw phpinfo in the script to make sure that the arg is
> being passed to php, and it shows that it is, yet the script never gets past
> the test: if( $thePhoto).
> 
> I put a call to phpinfo() before the LoadImageData() function just to see if
> the script even gets that far:
> 
> if( $thePhoto ) {
>       phpinfo();
>       LoadImageData();
>       DisplayPhoto( "$thePhoto" );
>   } else {
>       LoadImageData();
> 
>       if( count($photos) > 0 ) {
>           DisplayPhoto( "$photos[0]" );
>       } else {
>           PrintError( "Viewer error! can't load photos." );
>       }
>   }
> 
> I never see the phpinfo dump. To test this I entered
> "show.php?thePhoto=test.jpg" in a browser (with the correct url preceeding
> the script name). So, it appears PHP is never parsing the argv, or something
> major has changed between 4.05 and 4.23 where my test has to be re-written.
> 
> I'd appreciate some input.
> 
> Thanks.
> 
> --
> Mike Carter
> Pilot/Programmer
> [EMAIL PROTECTED]



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

Reply via email to