Hi all,

i understand that php header needs calling before any output.

i made a mistake and used it after an include which did output some html which gave the error.

but when testing on localhost with exact same code the header location redirect worked fine with no error?

any idea how?

Recommended Answers

All 3 Replies

Probably because warnings are turned off in the local php.ini.

wouldnt that just supress the warning and not actualy redirect?

Member Avatar

Suppressing the warning means that no output is posted. So the header should work.

Are your paths the same on server and localhost?

Is the server version the same as localhost or is it an old one? Sometimes a BOM can be saved in a file. That'll ruin your day.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.