开发者

Sending mail before changing header location

开发者 https://www.devze.com 2023-01-15 08:15 出处:网络
From php.net: <html> <?php /* This will give an error. Note the output * above, which is before the header() call */

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

精彩评论

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