I have a strange issue. It almost seems like a bug.
if ($object->error) {Form::BuildReturn(); header ("location:$url");}
Now if I echo the value of $url, I get the correct value: /projects/view/112/?edit-note=105
But when the script executes, it takes me to /projects/view/112/.
Here’s the weird part though: I can try to echo or print something right after the header and then it will take me to /projects/view/112/?edit-note=105 like I want it to. Example:
if ($object->error) {Form::BuildReturn(); header ("location:$url"); echo 0;}
I’ve tried searching this for about half an hour now using terms like ‘PHP header query string’, ‘PHP header get values’, and so on. I hope there is some actual solution to this rather than using a hacky workaround that generates ‘cannot modify header information’ warnings…
Try adding
exit;after redirecting. That stops executing the current file.