一个小小的购物车系统
来源:互联网 发布:北京的猎头公司知乎 编辑:程序博客网 时间:2024/05/01 10:53
index.php:
<?phpsession_start();?><html><head><meta http-equive="Content-Type" content="text/html; charset=utf-8" /><title>Shopping Cart</title></head><body background="pic/bg_02.gif"><table align="center"><tr><td width="1001" align="center"><img src="pic/bg_01.jpg"></td></tr><tr><td align="center"><table width="791"><tr><td width="200"><img src="pic/bg_03.jpg"></td><td width="579"><?phpswitch($_GET[link]){case "Computer";include_once("in_1.php");break;case "Home Theater";include_once("in_2.php");break;case "The automatic washing machine";include_once("in_3.php");break;case "Digital video camera";include_once("in_4.php");break;case "Mountain bike";include_once("in_5.php");break;default:include_once("in_image.php");}?></td></tr></table></td></tr></table></body></html>
in_1.php:
<?phpsession_start();$_SESSION[id] = "Liquid crystal dispaly#$_POST[num]parts#".($_POST[num]*900)."Yuan#30Yuan(self-care)#Gold VIP users and 88 percent discount";?><html><head><title>Shopping cart</title></head><style>body{ font-family:"楷体_GB2312"; font-size:14px;}</style><body text="#FFFFFF"><table><tr><td width="193"><img src="pic/1.jpg"></td><td width="282">Baby:Liquid crystal dispaly<br><br>One price for all:900Yuan<br> <br>freight:30元(self-care)<br><br>Characteristic services:<br><br><b style="color:#FF0000">Gold users and 88 percent discount</b><br><br>remaining baby:365part<br><br></td></tr></table><?php include_once("config/config.php");?></body></html>
至于in_2.php -----in_5,php基本类似,所以就不再贴出代码了。
config.php:
<form action="" method="post">I wang buy<input type="text" size="2" value="1" name="num">parts<input type="submit" name"sub" value="Add shopping cart" style="background-image:url(pic/button_2.jpg);color:red"><input type="submit" name="sub1" value="To check out"style="background-image:url(pic/button_3.jpg);color:red"><input type="submit" name="sub2" value="HOme"style="background-image:url(pic/button_1.jpg);color:red"></form><?phpif($_POST[sub2]){echo "<script>location.href='index.php'</script>"}if($_POST[sub]){$str=explode("#",$_SESSION[id]);include("calss/mysql.php");$sql="inser into tb_shop(id,name,number,money,moneyother,other)values('','$str[0]','$str[1]','$str[2]','$str[3]','$str[4]')";if(mysql_query($sql)){mysql_close($conn);echo "<script>alert('Already added to the shopping cart')</script>";}}if($_POST[sub1] || $_GET['sub1']){require_once("class/mysql.php");$sq="select * from tb_shop";$rs=mysql_query($sq);?><form action="config/table.php" method="post"><input type="submit" name="sub3" value="delete" style="background-image:url(pic/button_3.jpg);color:red"></form><table><?phpwhile($rst=mysql_fetch_row($rs))for($a=0;$a<6:$a++){?><tr><td><?php echo $rst[$a]?></td></tr><?php}?></table><a href ="config/money.php"><img src="pic/bu.jpg"></a><?php}?>
money.php:
<html><head><title>Shopping cart</title></head><body background="../pic/bg_02.gif" style="font-family:'楷体_GB2312';font-size:14px;" text="#FFFFFF"><br><br><br><br><br><br><table align="center" border="1" bordercolor="#FFFFF" cellspacing="0" ><tr><td align="center"><br>You have successfully paid,Looking forward to your next visit!!!<br><form action="" method="post"><input type="submit" name="sub7" value="Retirement"style="background-image:url(../pic/button_2.jpg);color:#FF0000"></form></td></tr></table></body></html><?phpif($_POST[sub7]){include("../class/mysql.php");$sqls="truncate table tb_shop";mysql_query($sqls);echo "<script>window.locaton.href='../index..php'</script>"}?>
table.php:
<html><head><title>Shopping cart</title></head><body background="../pic/bg_02.gif" style="font-family:'楷体_GB2312'; font-size:14px;" text="#FFFFFF"><table align="center"><tr><td><img src = "../pic/bg_01.jpg"></td></tr><tr><td><table width="1001"> <tr><td width="200"><table><tr><td><table cellspacing="0" border="1" bordercolor="red" bordercolorlight="red"><tr><td align="center"><tr><td> <br><form action ="" method="post"><input type ="text" size='20' value="Please enter to delete the commodity code" onFocus="this.value=''" name ="tt" ><input type="submit" name="sub4" value="Check" style="background-image:url(../pic/button_2.jpg); color:#FF0000" ><input type="submit" name="sub5" value="Back" style="background-image:url(../pic/button_2.jpg); color:#FF0000" ></form> </td></tr></table></td></tr><tr><td><img src = "../pic/bg_03.jpg"></td></tr></table></td><td width="789"></body></html><?phprequire_once("../class/mysql.php");$sq = "select * from tb_shop";$rs = mysql_query($sq);?><table><?phpwhile($rst = mysql_fetch_row($rs)){?><tr><td>Commodity code:<?php echo $rst[0];?></td><td>Commodity name:<?php echo $rst[1];?></td></tr><tr><td>Buy numbers:<?php echo $rst[2];?><hr></td><td>ALl price:<?php echo $rst[3];?><hr></td></tr><?php}?></td></tr></table></td></tr></table><?phpif($_POST[sub4]){$sqlser = "delete from tb_shop where id = '$_POST[tt]'";if(mysql_query($sqlser)){echo "<script>alert('Product deleted successfully')</script>";echo "<script>window.location.href='table.php';</script>";}}if($_POST[sub5]){echo "<script>window.location.href='../index.php?link=Computer&sub1=1';</script>";}?>
mysql.php:
<?php$conn = mysql_connect("localhost","root","root");mysql_select_db("db_database02",$conn);mysql_query("SET NAMES utf8");?>
0 0
- 一个小小的购物车系统
- 一个小小购物车案例
- 一个简单的PHP购物车系统
- 小小购物车
- 一个简单的购物系统
- 一个简单的购物系统
- 一个较为完整的购物管理系统
- 用jsp实现一个简单的购物车web应用系统。实现的添加购物商品,删除购物商品并且显示购物车信息。
- 一个购物车的类
- 一个购物车的实现
- servlet+jsp实现小小购物车功能
- 关于csdn blog系统的一个小小BUG
- 小小的例子系统
- 一个小小的烦恼
- 一个小小的错误
- 一个小小的问题
- 一个小小的问题
- 一个小小的Slider~
- Live templates(模板)
- 离开一个人有多难
- hadoop2.6.0版本集群环境搭建
- protobuf repeated类型的使用
- python基础教程_list列表应用
- 一个小小的购物车系统
- 复选框CheckBox
- ExtJS5 - 认识MVVM
- js中的标签页title
- 2015-12-16
- Android 启动白屏问题解决
- google closure继承机制
- cordova 工程中 引用google分析的功能。
- 关于POI的文件导入和导出