Page 1 of 1

echo "hardcoded" can be read from ExtJS but not echo $string

Posted: Fri May 21, 2010 11:02 am
by kevin-berry
Hi,

I posted this on the ExtJS forums and was suggested to try a php forum. The story goes like this:

An ExtJS function reads its input from a specified file.

When I view the file, which is a php file with a few functions, and ends with an echo statement, I see the correct output that the ExtJS should read and use.

The output from the php file is generated using an echo statement at the end of my file:

Code: Select all

echo $output;
For some reason, although the output prints on the php page, ExtJS does not interpret it.

So I tried:

Code: Select all

echo get_output();
Also with the same, failed results.

Curiously, I copied the output and hardcoded it like so:

Code: Select all

echo "this is the output";
And it worked!

Why. The. Heck.

I even tried having one file with the functions, and <include_once>-ing that file in another file which simply tried to output. I got all the same results as described with the above approaches.

I need the output to be dynamic - it can't be hard-coded, so why is this happening, and how can I make it work...

Thanks for any insight.

Kevin

Re: echo "hardcoded" can be read from ExtJS but not echo $st

Posted: Fri May 21, 2010 12:04 pm
by thinsoldier
Do a var_dump on get_output(); and $output at various points along the code to see if the expected data does actually make it to the end of the script. It could be that a typo somewhere is overwriting $output to not have a value.