⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addtocart.php

📁 《PHP专业项目实例开发》源代码
💻 PHP
字号:
<html><head><title> New Item added</title></head><body><?php$host="";$database="books";$dbusername="root";$dbpassword="";$x=mysql_connect($host,$dbusername,$dbpassword);$x1=mysql_select_db($database); $query = "Select customerid,productid from neworder where customerid='".$customerid."' and productid='".$productid."'"; $result=mysql_query($query); if ($row=mysql_fetch_array($result)) { die ("<h2>This products is already in your shopping cart !!</h2>"); }    $query="INSERT into neworder VALUES('','".$customerid."','".$productid."')";    $result=mysql_query($query);        ?><h1>The following was added to your shopping cart.</h1><table border=0><?php$query="select name, author, description, price from products where productid='".$productid."'";$result=mysql_query($query);if ($row=mysql_fetch_array($result)){echo "<tr><td>Title :</td><td>"      .$row["name"]  ." </td></tr>";echo "<tr><td>Author:</td><td>"      .$row["author"]  ." </td></tr>";echo "<tr><td>Description :</td><td>".$row["description"]  ." </td></tr>";echo "<tr><td>Price :</td><td>"      .$row["price"]  ." </td></tr>";}?></table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -