Re: [PHP] syntax error breaking in and out of php into html code

2012-08-27 Thread Tedd Sperling
On Aug 26, 2012, at 1:36 PM, Ashley Sheridan  wrote:
> Well, it turns out that I'm just an idiot...
> -- 
> Thanks,
> Ash

That was easy -- anyone of us could have told you that. :-)

Cheers,

tedd

PS: We all have our time in the barrel.

_
t...@sperling.com
http://sperling.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Ashley Sheridan
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
> 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:
> >
> >   > while(condition)
> > {
> > ?>
> > some html here
> >  > }
> > ?>
> >
> > 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
> >
> >
> >
> 
> 


Well, it turns out that I'm just an idiot. I'd missed where a couple of
short tags had been used!
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread tamouse mailing lists
On Sun, Aug 26, 2012 at 5:02 AM, Ashley Sheridan
 wrote:
>
> On Sun, 2012-08-26 at 04:36 -0500, tamouse mailing lists wrote:
>
> On Sat, Aug 25, 2012 at 9:56 PM, Ashley Sheridan
>  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
> >> 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:
> >> >
> >> >   >> > while(condition)
> >> > {
> >> > ?>
> >> > some html here
> >> >  >> > }
> >> > ?>
> >> >
> >> > 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.


Byte encodings? Line endings? Sorry, I'm sure you've thought of all this..

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Daniel Brown
On Sat, Aug 25, 2012 at 6:54 PM, Ashley Sheridan
 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:
>
>   while(condition)
> {
> ?>
> some html here
>  }
> ?>
>
> 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.

If it's not a violation of your arrangement with the owner of the
code, Ash, you can send it to me directly, off-list, and I'll take a
look at it.  I'm curious to see what might be causing the syntax
errors between PHP deployments as well.

-- 

Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Ashley Sheridan
On Sun, 2012-08-26 at 09:21 -0300, Samuel Lopes Grigolato wrote:

> Maybe you have a " allows short open tags? In production that setting could be disabled.
> 
> 
> On Sun, Aug 26, 2012 at 9:20 AM, Ashley Sheridan
>  wrote:
> 
> On Sun, 2012-08-26 at 11:02 +0100, Stuart Dallas wrote:
> 
> > On 26 Aug 2012, at 03:56, Ashley Sheridan
>  wrote:
> >
> > > 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.
> >
> >
> > Let me guess, line 356 is the last line of the file? That
> error is only caused by mis-matched braces, so the code you
> are deleting *must* contain either an errant opening brace or
> be missing a closing brace.
> >
> > -Stuart
> >
> > --
> > Stuart Dallas
> > 3ft9 Ltd
> > http://3ft9.com/
> 
> 
> 
> 
> It is the last line of the file, but it's not caused by a
> mismatched
> brace. I've tested by deleting just the code in the section
> where it
> breaks out of PHP and it runs without errors. It's a very
> weird issue,
> because this is code that is currently working on another
> server (which
> I don't have access to to match my own setup)
> 
> 
> --
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> 
> 
> 
> 


I don't see any, but it could be something along those lines. I turn off
short open tags on my machine, they cause more problems than they solve,
but it's probable that this setting is enabled on the server.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Samuel Lopes Grigolato
Maybe you have a "wrote:

> On Sun, 2012-08-26 at 11:02 +0100, Stuart Dallas wrote:
>
> > On 26 Aug 2012, at 03:56, Ashley Sheridan 
> wrote:
> >
> > > 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.
> >
> >
> > Let me guess, line 356 is the last line of the file? That error is only
> caused by mis-matched braces, so the code you are deleting *must* contain
> either an errant opening brace or be missing a closing brace.
> >
> > -Stuart
> >
> > --
> > Stuart Dallas
> > 3ft9 Ltd
> > http://3ft9.com/
>
>
> It is the last line of the file, but it's not caused by a mismatched
> brace. I've tested by deleting just the code in the section where it
> breaks out of PHP and it runs without errors. It's a very weird issue,
> because this is code that is currently working on another server (which
> I don't have access to to match my own setup)
>
> --
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Ashley Sheridan
On Sun, 2012-08-26 at 11:02 +0100, Stuart Dallas wrote:

> On 26 Aug 2012, at 03:56, Ashley Sheridan  wrote:
> 
> > 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.
> 
> 
> Let me guess, line 356 is the last line of the file? That error is only 
> caused by mis-matched braces, so the code you are deleting *must* contain 
> either an errant opening brace or be missing a closing brace.
> 
> -Stuart
> 
> -- 
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/


It is the last line of the file, but it's not caused by a mismatched
brace. I've tested by deleting just the code in the section where it
breaks out of PHP and it runs without errors. It's a very weird issue,
because this is code that is currently working on another server (which
I don't have access to to match my own setup)

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Stuart Dallas
On 26 Aug 2012, at 03:56, Ashley Sheridan  wrote:

> 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.


Let me guess, line 356 is the last line of the file? That error is only caused 
by mis-matched braces, so the code you are deleting *must* contain either an 
errant opening brace or be missing a closing brace.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Ashley Sheridan
On Sun, 2012-08-26 at 04:36 -0500, tamouse mailing lists wrote:

> On Sat, Aug 25, 2012 at 9:56 PM, Ashley Sheridan
>  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
> >> 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:
> >> >
> >> >   >> > while(condition)
> >> > {
> >> > ?>
> >> > some html here
> >> >  >> > }
> >> > ?>
> >> >
> >> > 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




Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread tamouse mailing lists
On Sat, Aug 25, 2012 at 9:56 PM, Ashley Sheridan
 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
>> 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:
>> >
>> >  > > while(condition)
>> > {
>> > ?>
>> > some html here
>> > > > }
>> > ?>
>> >
>> > 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...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] syntax error breaking in and out of php into html code

2012-08-25 Thread Ashley Sheridan
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
> 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:
> >
> >   > while(condition)
> > {
> > ?>
> > some html here
> >  > }
> > ?>
> >
> > 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




Re: [PHP] syntax error breaking in and out of php into html code

2012-08-25 Thread Duken Marga
Can you tell us what is the error shown in browser or CLI?

On Sun, Aug 26, 2012 at 5:54 AM, Ashley Sheridan
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:
>
>   while(condition)
> {
> ?>
> some html here
>  }
> ?>
>
> 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
>
>
>


-- 
Duken Marga


Re: [PHP] syntax error breaking in and out of php into html code

2012-08-25 Thread Adam Richardson
On Sat, Aug 25, 2012 at 6:54 PM, Ashley Sheridan
 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:
>
>   while(condition)
> {
> ?>
> some html here
>  }
> ?>
>
> 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.

I honestly can't think of a config setting that would cause a syntax
error for this type of example.

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] syntax error breaking in and out of php into html code

2012-08-25 Thread Ashley Sheridan
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:

 
some html here


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