开发者

Sending mail before changing header location

From php.net:

<html>
<?php
/* This will give an error. Note the output
 * above, which is before the header() call */
header('Location: http://www.example.com/');
?&g开发者_JAVA百科t;

Is it ok to read cookies and use mail() before changing header location?


header() will give errors, if something before it is printed on screen. If your cookie reading won't echo/print something out, then it should be ok. Same applies to mail().


Yes, it is perfectly OK to read cookie and use mail() before header location for redirecting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜