How cn we solve problem when we have warning : header already sent when we are using

header("Location: test.php");

suggest your answer

Well there's no "suggestion", if you get that error then you are sending data before you are using that function. You can use functions above header() but you cannot output anything before the heaader.
OK

$a = 2 + 2;
header('Location: example.com');

BAD

$a = 2 + 2;
echo $a;
header('Location: example.com');

Also note that this question has been answered umpteen times before, please do a search before starting a new thread.

Be a part of the DaniWeb community

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