0

I have a problem... When I use

header('location: index.php?error=3'); 

It works in localhost but not in my website uploaded. I mean, in localhost everything goes fine, but online it doesn't change page, it load only half of the page and that's it, with no image, et cetera.

EDIT: It does it with all header();

Thank you.

Tim
  • 3
  • 4
  • I'd personally change to WAMP Server, as it is much more used and is better maintained than EasyPHP. – AStopher Nov 18 '14 at 21:44

2 Answers2

4

header() calls should point to an absolute uri, try

header('location: http://example.com/index.php?error=3');

Replacing example.com with your own domain of course. See http://php.net/manual/en/function.header.php

Also check the log files, you might be getting a 'Headers already sent' warning that's not being displayed, see - How to fix "Headers already sent" error in PHP

Also check the Developer tools in chrome (ctrl+shift+i) - on the network tab you can see the full network traffic like http headers etc

Community
  • 1
  • 1
aland
  • 1,824
  • 2
  • 26
  • 43
0

Didn't found the problem (I checked all lines, deleted all spaces...)... so I gave up and I created the .user.ini file with

output_buffering = On            

And I'm studying computer science... lol

Thank you anyway.

Tim
  • 3
  • 4