On Sun, 2012-08-26 at 04:36 -0500, tamouse mailing lists wrote: > On Sat, Aug 25, 2012 at 9:56 PM, Ashley Sheridan > <ash@xxxxxxxxxxxxxxxxxxxx> wrote: > > On Sun, 2012-08-26 at 09:41 +0700, Duken Marga wrote: > > > >> Can you tell us what is the error shown in browser or CLI? > >> > >> On Sun, Aug 26, 2012 at 5:54 AM, Ashley Sheridan > >> <ash@xxxxxxxxxxxxxxxxxxxx>wrote: > >> > >> > I've just inherited some (pretty awful code) that I have to make some > >> > edits to, and came across a bit of a problem. A lot of the code breaks > >> > in and out of PHP and into HTML code: > >> > > >> > <?php > >> > while(condition) > >> > { > >> > ?> > >> > <li>some html here</li> > >> > <?php > >> > } > >> > ?> > >> > > >> > But when I check this my PHP parser is saying that this is a syntax > >> > error (checked in the browser and CLI). I know this is code from a > >> > working site, so it must be a setting within my PHP configuration. > >> > > >> > Now, I'm intending to re-write this anyway, as the logic is all over the > >> > place (SQL queries within the HTML, no separation of code and content, > >> > dozens of warnings all over the place) but I was wondering what setting > >> > causes this. It's mostly a curiosity thing really, as this thing is > >> > going to be re-written faster than an school project the eve before > >> > hand-in. > >> > > >> > -- > >> > Thanks, > >> > Ash > >> > http://www.ashleysheridan.co.uk > >> > > >> > > >> > > >> > >> > > > > > > Through the browser I get: > > > > Parse error: syntax error, unexpected $end > > in /var/www/html/siteinquestion/index.php on line 356 > > > > Through the CLI I get: > > > > PHP Parse error: syntax error, unexpected $end in index.php on line 356 > > > > Parse error: syntax error, unexpected $end in index.php on line 356 > > > > Errors parsing index.php > > > > I've narrowed it down to the lines that used the breaking in and out of > > PHP style. As soon as I comment out those it runs fine, albeit without > > the content that code was intended to add. > > > > -- > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > I guess I would suspect errant spaces, or a missing closing tag, or > even maybe a short code or something... very hard to say... > None of the above. This is a working copy of code. It's just to do with these lines breaking in and out of PHP. -- Thanks, Ash http://www.ashleysheridan.co.uk