I found the link to the zope page about how you can use
echo|print <<< EOF
text
EOF;

I used it and it works, but when I put it in a loop like

while($myrow = mysql_fetch_array($result))
{
echo <<< EOF
1
EOF;
}

This should in my mind print out the number 1 once for each record. but I get
"Parse error: parse error in /home2/campmeriwether/testing.php on line 33"

line 33 is the last line of my script all it has is ?>

the code works fine if I replace the echo with ?> and the EOF; with <? but I don't want to do it that way if I don't have to.
Anyone else had this problem?
thanks

    I'm not 100% sure about how you indent your while loop (since these forums get rid of all indentation, grrr), but I assume you do use indentation...

    Anyways, I've heard that the EOF; on the end of the echo statement MUST be all the way to the left margin (col 0)... That may be why you are having problems when it is in the while loop.

    Hope that helps some 🙂

    -Josh

      yes I do indent, I do have the EOF; at col 0.
      though my question has changed since was able to loop.
      while($i < 2)
      {
      $i++;
      echo <<< EOF
      text <br />
      $leftmenu
      $var1
      EOF;
      }
      works fine,
      I'm not really sure what my problem is anymore. If someone out there has a better write up of this feature then that zope page pleace pass it along. Other wise I might just write one after I get this figured all out. (that or break something)

        Write a Reply...