b.php<?php
switch($act) {
case 'add' :
if(strpos($_REQUEST['pid'], ',') !== FALSE) {
//union products
$pid = explode(',', $_REQUEST['pid']);
$class_cart->add_cart($pid, 1, 'union');
} else {
$pid = (int)$_REQUEST['pid'];
if(! empty($pid)) {
$class_cart->add_cart((array)$pid);
}
}
//change url
header('Location:b.php');
break;
}
?>
各位大侠,这段代码就是在b.php文件中,当我添加产品是会定向到b.php,请问是怎么把添加到购物车的产品在它转向时在传到该页面。
switch($act) {
case 'add' :
if(strpos($_REQUEST['pid'], ',') !== FALSE) {
//union products
$pid = explode(',', $_REQUEST['pid']);
$class_cart->add_cart($pid, 1, 'union');
} else {
$pid = (int)$_REQUEST['pid'];
if(! empty($pid)) {
$class_cart->add_cart((array)$pid);
}
}
//change url
header('Location:b.php');
break;
}
?>
各位大侠,这段代码就是在b.php文件中,当我添加产品是会定向到b.php,请问是怎么把添加到购物车的产品在它转向时在传到该页面。
可是我网站上的链接后没有参数。如果说用SESSION又怎么用呢?能不能讲下原理。在此谢过。