【发布时间】:2011-05-05 08:46:16
【问题描述】:
我在会话中存储了信息。但是我刚刚发现,当您执行 file_get_contents() 时,会话不起作用。
所以经过一番搜索,我想到了使用这种技术:
$cart = base64_encode(serialize($_SESSION['cart']));
我传递我的会话购物车,对其进行序列化和编码。然后我将它传递给 file_get_contents。
$url = "http://www.domain.com/pdf_order.php?cart=".$cart;
$html = file_get_contents($url);
在它获取的 URL 中,我有这个:
$cart = unserialize(base64_decode($_GET['cart']));
但我什么也得不到。 我可以打印出 GET 购物车并且我有一个编码字符串,但是我不能用它做任何事情。
任何帮助,非常感谢。
【问题讨论】:
-
回显
"http://www.domain.com/pdf_order.php?cart=".$cart;会得到什么 -
@Sydenam - 查看更新...谢谢。
标签: php session file-get-contents