[英]Shopping cart more details
我正在購物車,我想進入新窗口“更多關於物品”。
它get cart.php?more=id
,但是頁面上沒有任何顯示。
cart.php-代碼的一部分:
$page2 = 'more.php';
if(isset($_GET['more'])){
$_SESSION['cart_'.(int)$_GET['more']];
}
function more(){
$get = mysql_query('SELECT id, name, price FROM products WHERE id='.mysql_real_escape_string($id));
while($get_row = mysql_fetch_assoc($get)){
echo '<p>'.'<b>Name: </b>'.$get_row['name'].'<br/>'.'<b>About: </b>'.$get_row['description'].'<br/>'.'<b>Quantity: </b>'.$get_row['quantity'].'<br/>'.'<b>Price: </b>'.number_format($get_row['price'], 2).' $</p>';
}
header('Location: '.$page2);
}
function products(){
$get=mysql_query('SELECT id, name, description,quantity,price FROM products WHERE quantity > 0 ORDER BY id DESC');
if (mysql_num_rows($get)==0){
echo "There are no products to display!";
}
else{
while ($get_row = mysql_fetch_assoc($get)){
echo '<p>'.'<b>Name: </b>'.$get_row['name'].'<br/>'.'<b>About: </b>'.$get_row['description'].'<br/>'.'<b>Quantity: </b>'.$get_row['quantity'].'<br/>'.'<b>Price: </b>'.number_format($get_row['price'], 2).' $'.'<a href="cart.php?add='.$get_row['id'].'"> Add</a>'.'<a href="cart.php?more='.$get_row['id'].'"> More</a></p>';
}
}
}
你應該改變
<a href="cart.php?more='.$get_row['id'].'"> More</a>
成
<a href="cart.php?more='.$get_row['id'].'" target="_blank"> More</a>
成功!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.