FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » syntax error or notepad++ error?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: syntax error or notepad++ error? [message #182823 is a reply to message #182818] Mon, 16 September 2013 17:14 Go to previous messageGo to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
On Mon, 16 Sep 2013 11:12:22 -0400, Jerry Stuckle wrote:

> On 9/16/2013 9:20 AM, richard wrote:
>> All is well with matching divisions in notepad++ until I enter this code:
>>
>> echo "<div class='bcol2'>";
>> echo "* ".$number." *<br />";
>> echo '<a
>> href="http://mroldies.net/index2.php?year='.$year.'&amp;nid='.$number.'">';
>> echo $vid[0];
>> echo "</a>";
>> echo "<br />";
>> echo $vid[1];
>> echo "<br />";
>> echo $vid[3];
>> echo" </div>\n";
>>
>> $number++;
>>
>> Notepad++ matches the opening division with the very last closing division
>> tag.
>> Not the closing tag it is supposed to pair with.
>> Without this code, the pairs match.
>>
>> So where's the syntax issue at?
>>
>> I made sure all tags matched properly before including the code.
>>
>
> There's a limit as to how much editors can interpret the code. For
> instance, they can't properly parse something like:
>
> <?php if ($i == 3)
> echo "<div class='foo'\n";
> ?>
>
> because $i is only meaningful during the execution of the page.
>
> They also don't handle things like:
>
> echo "<";
> echo "div ";
> echo "class='foo'";
> echo ">\n";
>
> Even though this generates perfectly valid HTML (I know you wouldn't
> write it like this, but it's an example).
>

Actually, notepad++ does accept all you listed except the < and > signs.


> As a result, when you mix things like regular html and html generated by
> php (or any other language), editors are bound to get confused at some
> point in time. It's just a limit of what editors can do.
>
> The best way is to run the generated page through the HTML validator, as
> Denis suggested.

I did and it did not find anyhting out of whack.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problem with many buttons
Next Topic: Browser fingerprinting?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 13:23:54 GMT 2024

Total time taken to generate the page: 0.05038 seconds