-1

After i moved my files from my localhost "iis" to apache on a webhotell. I keep getting this error that says "Warning: Cannot modify header information - headers already sent by (output started at /home/waiokqbg/public_html/index.php:37) in /home/waiokqbg/public_html/Engine/php/classes/users.class.php on line 50"

It says that headers aldreay sent by index.php on line 37, and here how the code looks like on line 37 index.php:

<div id="loginwrap" <?php if(isset($_GET['noticelogin'])){echo"style='display: block'";} ?>>

and in users.class.php on line 50:

    header("location: http://www.mediaview.nu/index.php?noticelogin=0");

Help would be appreciated

Eymen
  • 3
  • 3

3 Answers3

2

When you use a header, you have to make sure that there is no code that has been rendered above it, like HTML for example.

Consider the following example:

<?php
    ...
    header("location: http://www.mediaview.nu/index.php?noticelogin=0");
    ...
?>
<html>
    ...

Any header calls must be made before any output is sent.

You can read more about it here.

Nick Zuber
  • 5,467
  • 3
  • 24
  • 48
0

It means that there is some extra information before php execution : makes sure you are following layout.

------- There should not be anything here----------
<?php  

   echo "your code here";

?>
thepiyush13
  • 1,321
  • 1
  • 8
  • 9
0

It is not an error @ line 50. May be your code sent an error message before and when line 50 arrives you get this message.

I suggest you, run this code separately in order to get the first error message.

You can run writing an URL with dummy parameters for instance

index.php?noticelogin=OK&anotherparame=TEST 
Claudio
  • 296
  • 2
  • 6