Hi, just curious to know if you have any blank lines in your code - or characters before the first <?php tag, also I would add a exit(); just after the header(); code. Note: the location: www.example.com must be in " or ’ quotes.
eg
{start of file}
<?php
if(x==0)
{
header("location...