Re: about wml and session
| From: | Ruslan Ohitin | Date: | Tue, 10 Jul 2001 10:28:39 +0000 |
| Subject: | Re: about wml and session | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-8219@lists.php.net to get a copy of this message | ||
Hello gary,
Try to put session_* functions before any output (echo, etc):
session_start();
session_register("temp");
header("Content-type: text/vnd.wap.wml");
echo ("<?xml version=\"1.0\" ?>\n");
echo ("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">");
g> Hi all,
g> I am trying to use session in my wml. So, I add the following
g> statement in my php.
g> header("Content-type: text/vnd.wap.wml");
g> echo ("<?xml version=\"1.0\" ?>\n");
g> echo ("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
g>
g> \"http://www.wapforum.org/DTD/wml_1.1.xml\">");
g> session_start();
g> session_register("temp");
g> But it's not sucessful and I get the following error message. Should I
g> set some parameter to use session in wml format? Can anyone help me?
g> Thanks!
g> <b>Warning</b>: Cannot send session cookie - headers already sent by
g> (output started at c:\inetpub\wwwroot\dinol\index.php:3) in
g> <b>c:\inetpub\wwwroot\dinol\index.php</b> on line <b>6</b><br>
g> <br>
g> <b>Warning</b>: Cannot send session cache limiter - headers already
g> sent (output started at c:\inetpub\wwwroot\dinol\index.php:3) in
g> <b>c:\inetpub\wwwroot\dinol\index.php</b> on line <b>6</b><br>
session_start() wants to send a cookie with session id, but it can't.
g> Gary
--
Best regards,
Ruslan Ohitin
mailto:rus@bagan.ru