Richard Korts
asked on
What is php error?
This url:
https://www.lakoshvac.com/devdev/adj_markup.php?fr=smod&mfp=Y&mval=.95&selno=3098
This result:
Parse error: syntax error, unexpected end of file in /home/lakoshva/public_html /devdev/ad j_markup.p hp on line 13
php source run through https://phpcodechecker.com/. No errors
Source attached.
What is the issue, I cannot see it?
adj_markup.php
https://www.lakoshvac.com/devdev/adj_markup.php?fr=smod&mfp=Y&mval=.95&selno=3098
This result:
Parse error: syntax error, unexpected end of file in /home/lakoshva/public_html
php source run through https://phpcodechecker.com/. No errors
Source attached.
What is the issue, I cannot see it?
adj_markup.php
ASKER
Yeah, I did not notice the double header, that may be it. I will fix.
The include is just the database connection, it’s in every php program in the system.
Thanks,
Richard
The include is just the database connection, it’s in every php program in the system.
Thanks,
Richard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Gr8gonzo,
I understand that so called parsing errors are php syntax errors. The php syntax error checking site I indicated earlier is, in my experience about 99% correct.
So I think the odds of a parsing syntax error are about 1%.
I am not a Unix / Linux person, I will try to check as you suggest tomorrow. I can get my host to do that if need be.
Thanks
I understand that so called parsing errors are php syntax errors. The php syntax error checking site I indicated earlier is, in my experience about 99% correct.
So I think the odds of a parsing syntax error are about 1%.
I am not a Unix / Linux person, I will try to check as you suggest tomorrow. I can get my host to do that if need be.
Thanks
Sorry, I was unclear. I wasn't suggesting the site was wrong. I'm saying I think you might have the wrong script - maybe you were checking the wrong copy of the file. So I was recommending you run a lint check (and also rename) to check whether you were looking at the right or wrong file.
ASKER
I asked the host to do php -l /home/lakoshva/public_html /devdev/ad j_markup.p hp.
They responded with:
Check it now, it was missing a bunch of line breaks.
Line 12 had the lines for the rest of the files.
It now works!!
I am a little surprised with line breaks being an issue. I thought the ; in php defined the start of a new command, you could string them all together on one line.
They responded with:
Check it now, it was missing a bunch of line breaks.
Line 12 had the lines for the rest of the files.
It now works!!
I am a little surprised with line breaks being an issue. I thought the ; in php defined the start of a new command, you could string them all together on one line.
Sounds like a questionable response from the host. Whitespace in PHP is generally ignored, so you can string together as many lines as like. The code you posted had all the line breaks in all the right places, so something else was going on!
ASKER
That's what I thought, but the revised version (by the host) works, I have tried it.
Richard
Richard
I agree - line breaks shouldn't be a problem. Like Chris said, whitespace is typically ignored - the semicolon is the thing that matters. The "Line 12 had the lines for the rest of the files" sounds very odd - almost like there was some other unusual whitespace happening that wasn't really whitespace.
FYI - You do have 2 header() calls on the same line, although that's unlikely to be the cause of your problem, but it should still be fixed:
Open in new window