欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

PHP购物车

程序员文章站 2022-06-03 19:38:45
...
跳至
<?php session_start();
 $conn=mysql_connect("localhost","root","admin");
 mysql_select_db("songyu");
 //检查数组元素出现次数
 function check_count($array,$element)
 {
 	$times=0;
 	for($i=0;$i


<?php session_start();
 $conn=mysql_connect("localhost","root","admin");
 mysql_select_db("songyu");
 $sql="select * from user where username='".$_POST["username"]."' and password='".$_POST["password"]."'";
 $result=mysql_query($sql);
 $out=mysql_fetch_array($result);
 if(!$out)
 {
 	echo "wrong!";
 }
 else
 {
 	$_SESSION["user"]=$out[id];
 	echo "
相关标签: PHP购物车