how do i redirect the browser with php inside a function?:rolleyes:
using
header("Location: noticia?ID=$xu");
returns :
Warning: Cannot add header information - headers already sent by (output started at C:\apache\htdocs\rvp\gest\sen2.php:7)
why this happens can't redirect like this can anyone giveme an ideia before i kill myself??
😕
Just a guess, but shouldn't
be something like
header("Location: noticia.php?ID=$xu");
The other thing is header needs to be the first thing you send before anything else is outputted.
Cgraz
Also, the url in the header needs to be in full so if you want to just sent the user to a file in the same directory, you need to do:
header("Location: [url]http://[/url]".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/noticia.php?ID=$xu");