I am trying to put a javascript BEFORE a session_start(); in php. the problem is that when I run the page an error says that the headers are already sent bu the line in which I have my javascript and that the session can not start.
the same problem occurs when I try to make a browser redirection: header('Location: page2.php'); after the <htm> or <body> tag.
this is very strange because in the web server I was before I didnt have the header problems when trying to redirect the browser after html tags, now Im on a new server and It just let me redirect the browser or start a session if I put the code at the beggining of the page before any html or javascrpt tag.
does anyone has an idea what could be the problem????? I was thinking that maybe is a php configuration or something. how can I configure it do It ccould work just like before.
thanks