1

The issue started with this question: Why does this `$_SESSION = $_POST` fail?

After some time I found that my problem described in that question is caused by the comment // in PHP (as described in the last update in the question).

I suspect my editor Notepad++ to have some kind of influence on this.

As an example, if I write:

<?
echo "test1<br>";
echo "test2<br>";
echo "test3<br>";
// Comment
echo "test4<br>";
echo "test5<br>";
?>
<?
echo "test6<br>";
echo "test7<br>";
echo "test8<br>";
?>

everything after the comment // Comment inside the current <?...?> is ignored. The output to the above is thus:

test1
test2
test3
test6
test7
test8

The other kind of comments /*...*/ works fine.

Strangely it only happens on comments that I edit or create. All other untouched comments do no harm. There might be some Notepad++ setting causing this that I don't know of. If have experienced before that "invisible" things happen when you fiddle around with the program, so I might have done something wrong at somepoint.

Any suggestions?

0

1 Answer 1

5

Check your line endings! Save the file with unix style line endings. (Edit > EOL Conversion > UNIX format)

Sign up to request clarification or add additional context in comments.

1 Comment

How do you do that in Notepad++?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.