If you are opening the file with fread instead of using "include()" then it 
wont parse properly ...

from an ajax response anything echoed back from a php script will just 
return html/text/json/xml/javascript/css etc etc back to the responseText

Could you give an example fo your code and the php page and i will try to 
help you


----- Original Message ----- 
From: "Robaj" <robrass...@gmail.com>
To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
Sent: Tuesday, June 23, 2009 3:01 PM
Subject: [Proto-Scripty] php in files

> I know this isn't strictly speaking a Prototype issue, but this is the
> only group I am in and a few topics do skirt around the edges of your
> main topic.
> If I have a file -
> home.php
> <?php
> echo "<h1>A very interesting home page</h1>";
> ?>
> Then the file is returned to go into <div id="mainbody"></div> with a
> plain fread() into a variable which is 'echo'd back to the client.
> 'include'ing this file is fine, but then it passes through php at the
> same time as everything else.
> But any such file loaded as the action of an Ajax call is not fine. It
> doesn't get passed via php, or at least I don't think it does -
> because in 'mainbody' I get part of it such as
> Interesting"; ?>
> Confusing because if it were being passed through php I would expect
> 'Interesting'. but if it were not, then I would expect the whole file
> in plain text.
> I knew when I did this with fread I was probably heading for trouble,
> but which is happening,
>   partial php parseing,
>   no php parseing or
>   ..... ?
> >

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to