# WAP browser redirect in php

## Recommended Posts

Dracodev    132
Hi all, I've got code looks something like this wml <anchor> <go href="check.php" method="post"> <postfield name="pin_num" value="$(pin_num)"/> </go> </anchor> and php if(isset($_POST["pin_num"])) { header("Location: http://www.druidev.com/downloads.wml"); } and keep getting this error message Warning: Cannot modify header information - headers already sent by (output started at /home/druid/public_html/wap/check.php:2) in /home/druid/public_html/wap/check.php on line 11 I've been trying to figure this out all day. Anyone have any idea's Cheers Kev

##### Share on other sites
ApochPiQ    23064
You've already sent something to the browser (usually HTML or some other data) when you call the header() function. This won't work. You need to make calls to header() before you send anything to the browser. If you can't rearrange your code to put the header() call before HTML/data starts getting output, then you'll have to look into output buffering. See the PHP.net documentation on header() for more information.