|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用cdonts,可以发送、查看邮件,实现webmail的功能。结合wsh,可以实现对nt主机的管理,如nt用户管理、iis虚拟主机设置、exchange邮箱设置等等,就像管理本地机一样方便。cookie|购物车cookie的功效与购物车
zif宣布于2000-01-1116:13:00
在网上闲逛,发明一好东东,设法不错的!
可在小型的网上商铺中利用.
自己鄙人面列出源代码,人人好好使用!
好甚么心得,告知我一下哦!
------------------------------------
products.html
<html>
<head>
<title>ClaremontToyworld</title>
<scriptLANGUAGE="JAVASCRIPT">
functionSetCookie(name,price,form){
document.cookie=document.cookie+":"+name+":";
document.cookie=document.cookie+""+":";
document.cookie=document.cookie+price+":";
document.cookie=document.cookie+""+":";
document.cookie=document.cookie+"|"+";";
}
</script>
</head>
<bodytext="#000000"bgcolor="#FFFF00"link="#0000EE"vlink="#551A8B"alink="#FF0000">
<ahref="trolley.html">here.</a>
<tableBORDER="0"CELLSPACING="0"CELLPADDING="0"COLS="3"width="75%">
<tr>
<td><strong>Furby</strong></td>
<td>TheAmazingPet</td>
<td><small>AUD</small>$69.95<fontsize="-2">+<ahref="#Postage">postage</a></font></td>
<td><form>
<p><inputTYPE="BUTTON"VALUE="Addtocart"NAME="Additem1"
onclick="SetCookie(Furby,69.95,this.form);"></p>
</form>
</td>
</tr>
</table>
</body>
</html>
----------------------------------------
trolley.html
<html>
<scriptLANGUAGE="JAVASCRIPT"src="trolley.js">
</script>
</head>
<body>
<tableCOLS=2WIDTH="100%">
<tr>
<td>
</td>
</tr>
</table>
<formname="TrolleyContents"ACTION="formmail.pl"METHOD="POST"><inputtype="hidden"name="email"value="email">
<scriptLANGUAGE="JAVASCRIPT">
tableOfNRows(NumberOfItems(document.cookie,option_separator,item_separator));
</script>
<tableCOLS=4WIDTH="100%">
<tr>
<td><inputtype="button"value="<--Backtoshopping"onclick="window.close();"></td>
<td><inputtype="button"value="Clearshoppingtrolley"onclick="ClearTrolley();"></td>
<td><ahref="#Finalise">Finaliseorder</a></td>
<td></td>
</tr>
</table>
<h1>
<scriptLANGUAGE="JAVASCRIPT">
totalTable();
</script>
</body>
</html>
----------------------------------------
trolley.js
//remtrolley.jssourceCopyrightPrestigeTrainingCentre
option_separator=":";
item_separator="|";
functionNumberOfItems(string,option_separating_char,item_separating_char){
//returnsthenumberoftrolleyitems
if(string==""){
alert("Yourshoppingtrolleyiscurrentlyempty.");
return0;
}
//countthenumberofitemseparators
num_sep_found=0;
num_fin_found=0;
finished=-1;
pos=0;
while(finished!=1)
{
if(string.charAt(pos)==option_separating_char)num_sep_found++;
if(string.charAt(pos)==item_separating_char)
{
num_fin_found++;
if(string.charAt(pos+1)!=option_separating_char)finished=1;
}
pos++;
}
//dividebythenumberofendsfound
num_sep_found=num_sep_found-num_fin_found;
//if(num_fin_found>0)returnnum_sep_found/num_fin_found;
returnnum_fin_found;
}
functionClearTrolley(){
if(confirm("Clearthecontentsofyourshoppingtrolley?"))
{
document.cookie="";
history.back();
}
}
functiongetElement(terminator,index,string){
//findnthterminator
pos=0;
for(inc=1;inc<index+1;inc</p>优点:简单易学、开发速度快、有很多年“历史”,能找到非常多别人做好的程序来用、配合activeX功能强大,很多php做不到的asp+activeX能做到,例如银行安全控件 |
|