Not positive, but you might want to try it as two separate headers (in this order):
header('Window-target: _parent');
header('Location: index.php');
Note: to be HTTP/1.1 compliant, you should actually use the full URL for the location header value.
Ultimately, probably the best solution would be to get away from using HTML frames at all, as the ancillary problems they bring with them tend to offset their usefulness (page bookmarking and search engine access to name a couple).