0

I am using xampp 1.6.3 and notepad++ 4.7.2 and later 5.9.8.

In a page that we redirect to this page using header("Location:page.php"), the IDE or something else put a \n or RETURN or when it turn to html <br>. I mean before session_start() there is an unwanted html character which cause session not working. I found out this when I saw html source, not in the IDE)

What do I have to do right now?

Milad R
  • 1,854
  • 9
  • 25
  • 36
  • If said "IDE" doesn't have a setting for those automatic additions, then there's no way to "prevent" it. At least not the injected `
    ` tags. For whitespace issues (in 2012!) there are automated [tools for post-processing](http://stackoverflow.com/a/8584233/345031).
    – mario Mar 08 '12 at 21:34
  • You might have this issue: [Remove BOM from utf-8 files](http://www.sunfinedata.com/tips/remove-bom-from-utf-8-files/) – hakre Mar 08 '12 at 21:37

2 Answers2

1

I believe you have some includes and one of the included files have some extra characters at the end. Please trim the files off any extra whitespace. Also it is a good practice to omit the ending php tag to avoid such scenarios.

masnun
  • 11,635
  • 4
  • 39
  • 50
0

If you're unable to find the offending output, you could try to work with output buffering as a workaround.

Surreal Dreams
  • 26,055
  • 3
  • 46
  • 61