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

📄 gwzh.php

📁 网上书店网站系统
💻 PHP
字号:
<?
function conndb()
{
	$db=@mysql_pconnect("localhost","root","307910");
	if($db==false)
	{
		print "Database failed!";
		exit();
	}
	return $db;
}
function printhead()
{
	print '<html><head><title> 搜索结果</title>';
	print '<meta content="text/html;charset=gb2312" http-equiv=Content-Type></head>';
	require("index.html.inc");
	print '<body><form action=order.php method=post>';//////////////////////////////////////////
	print '<table border=1 sidth="70%" height=200 align=center><tbody>';
}
session_start();
if(!session_is_registered("bookseller"))
{
	printhead();
	print "<p align=center>";
	print "You have not log into the shopping system!<br>";
	print "You can <A href=\"shequ.php\"><cont color=#cc0066>LOGIN";
	print "</font></A> now,or click here to <A href=\"personelinfo.html\"> ";
	print "<font color=#cc0066>REGISTER</font></A> yourself!<br>";
	print "After you have logged in,you can use shopping car freely!";
}
else
{
	$db=conndb();
	if(!strcmp($action,"add"))
	{
		printhead();
		$res=@mysql_db_query("bookseller","select * from $bookseller where isdn=$isdn;",$db);
		if(@mysql_num_rows($res)==0)
		{
			@mysql_db_query("bookseller","insert into $bookseller values(1,$isdn);",$db);
		}
		else if(!strcmp($botton,"update"))
		{
			printhead();
			$query="select quantity,title from books where isdn=$isdn";
			$res=@mysql_db_query("bookseller",$query,$db);
			$row=@mysql_fetch_row($res);
			if($quantity<=$row[0])
			{
				@mysql_db_query("bookseller","update $bookseller set quantity=$quantity where isdn=$isdn;",$db);
			}
			else
			{
				print "Book $row[1] has only $row[0] copies in store,but you want $quantity.<br>";
			}
		}
	}
}
?>
<?
require("foot.html.inc");
?>

⌨️ 快捷键说明

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