I wasn't too clear about how the referer header works if sent on a php page on domain Z. Does it mean that it will send to the destination server a referer specified in the header, even if it is not the actual referer of the site?
e.g.
header("Referer: [wanttosendthis.com");...]
header("Location: [anothersite.com");...]
With anothersite.com show in it's logs the referer as wanttosendthis.com?