Reputation: 1
I created a different file for the header(header.html) and I include that file in other pages as well. Now the problem is when I create links for the nav elements ,i cannot redirect to the different pages. I'm running my application in localhost.Can you please tell me what's wrong with that?
Upvotes: 0
Views: 49
Reputation: 43
Make sure you don't echo anything before you send the headers. Also check your error logs, it would give you (and us) much more valuable information on whats going wrong here. Headers need to be the first thing sent to the DOM, or in other words NO HTML BEFORE HEADERS!
Upvotes: 0
Reputation: 356
This seems wrong.
header(header.html);
use
header("Location: header.html");
Upvotes: 2