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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kevin-berry
Forum Newbie
Posts: 1
Joined: Fri May 21, 2010 10:51 am

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

Post 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
thinsoldier
Forum Contributor
Posts: 367
Joined: Fri Jul 20, 2007 11:29 am
Contact:

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

Post 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.
Warning: I have no idea what I'm talking about.
Post Reply