Ò»¸ö±È½ÏÍêÉÆµÄPHP¹ºÎï³µÀà
<?
/*****************************************************************************/
/* */
/* file type: °üº¬Îļþ£¬½¨Òéºó׺Ϊ.inc */
/* */
/* file name: cart.inc */
/* */
/* Description: ¶¨ÒåÒ»¸ö¹º³µÀà */
/* */
/* Func list : class cart */
/* */
/* author : bigeagle */
/* */
/* date : 2000/12/24 */
/* */
/* History: 2000/12/24 finished */
/* */
/*****************************************************************************/
//¶¨Òå±¾Îļþ³£Á¿
define("_CART_INC_" , "exists") ;
/*¹ºÎï³µÀà*/
class TCart
{
var $SortCount; //ÉÌÆ·ÖÖÀàÊý
var $TotalCost; //ÉÌÆ·×ܼÛÖµ
var $Id; //ÿÀàÉÌÆ·µÄID£¨Êý×飩
var $Name; //ÿÀàÉÌÆ·µÄÃû³Æ£¨Êý×飩
var $Price; //ÿÀàÉÌÆ·µÄ¼Û¸ñ£¨Êý×飩
var $Discount; //ÉÌÆ·µÄÕÛ¿Û£¨Êý×飩
var $GoodPrice ; //ÉÌÆ·µÄÓŻݼ۸ñ£¨Êý×飩
var $Count; //ÿÀàÉÌÆ·µÄ¼þÊý£¨Êý×飩
var $MaxCount ; //ÉÌÆ·ÏÞÁ¿£¨Êý×飩
//******¹¹Ô캯Êý
function TCart()
{
$this->SortCount=0;
session_start(); //³õʼ»¯Ò»¸ösession
session_register('sId');
session_register('sName');
session_register('sPrice');
session_register('sDiscount');
session_register('sGoodPrice') ;
session_register('sCount') ;
session_register('sMaxCount') ;
$this->Update();
$this->Calculate();
}
//********˽ÓУ¬¸ù¾ÝsessionµÄÖµ¸üÐÂÀàÖÐÏàÓ¦Êý¾Ý
function Update()
{
global $sId,$sName,$sPrice,$sCount,$sDiscount,$sMaxCount,$sGoodPrice;
if(!isset($sId) or !isset($sName) or !isset($sPrice)
or !isset($sDiscount) or !isset($sMaxCount)
or !isset($sGoodPrice) or !isset($sCount)) return;
$this->Id =$sId;
$this->Name =$sName;
$this->Price =$sPrice;
$this->Count =$sCount;
$this->Discount = $sDiscount ;
$this->GoodPrice = $sGoodPrice ;
$this->MaxCount = $sMaxCount ;
//¼ÆËãÉÌÆ·×ÜÊý
$this->SortCount=count($sId);
}
//********˽ÓУ¬¸ù¾ÝеÄÊý¾Ý¼ÆËãÿÀàÉÌÆ·µÄ¼ÛÖµ¼°È«²¿ÉÌÆ·µÄ×ܼÛ
function Calculate()
{
for($i=0;$i<$this->SortCount;$i++)
{
/*¼ÆËãÿ¼þÉÌÆ·µÄ¼ÛÖµ£¬Èç¹ûÕÛ¿ÛÊÇ
Ïà¹ØÎĵµ£º
這個問題ÓÐ點Ææ¹Ö£¬ÔÚJavaºÍ.netµÄÊÀ½ç裡還δÅöµ½過.......
¿´來PHP對對ÏóµÄÖ§³Ö還²»ÊÇÌ«ÓѺ㬺ǺÇ~~~
[轉載ì¶£º] http://blog.csdn.net/yehell/archive/2007/12/19/1953826.aspx
½ñÌìÔÚphpÎļþÖÐÉèÖÃÁËÒ»¸ösession.²¢½«Ò»¸öÀ ......
When I deploy php application on apache, some problem come out, and solved. Here's the tips and problems solved.
0.How could I deploy an apache server armed with php, mysql, perl, and phpMyAdmin on the fly?
You need a package bundled with all these tools, xampp shall meet you needs, you can ......
¡¡»¥ÁªÍøµÄ½ñÌ죬AJAXÒѾ²»ÊÇʲôİÉúµÄ´Ê»ãÁË¡£ËµÆðAJAX£¬¿ÉÄÜ»áÁ¢¼´ÏëÆðÒòRSS¶øÐËÆðµÄXML¡£XMLµÄ½âÎö£¬¿ÖÅÂÒѾ²»ÊÇʲôÄÑÌâ
ÁË£¬ÌرðÊÇPHP5£¬´óÁ¿µÄXML½âÎöÆ÷µÄÓ¿ÏÖ£¬Èç×îÇáÁ¿¼¶µÄSimpleXML¡£²»¹ý¶ÔÓÚAJAXÀ´Ëµ£¬XMLµÄ½âÎö¸üÇãÏòÓÚǰ̨Javascript
µÄÖ§³Ö¶È¡£ÎÒÏëËùÓнâÎö¹ýXMLµÄÈË£¬¶¼»áÒòÊ÷ºÍ½Úµã¶øÍ·´ó¡£²»¿É·ñÈÏ£¬X ......
×î½üÑо¿PHPµÄһЩ¿ª·¢¼¼Êõ£¬·¢ÏÖPHPÓкܶàASPËùûÓеÄÓÅÐ㹦ÄÜ£¬¿ÉÒÔÍê³ÉһЩÒÔǰÎÞ·¨Íê³ÉµÄ¹¦ÄÜ£¬ÀýÈ綯̬Éú³ÉHTML¾²Ì¬Ò³Ã棬ÒÔ¼õÉÙ·þÎñÆ÷CPUµÄ¸ºÔØ£¬Ìá¸ßÓû§·ÃÎʵÄËÙ¶È¡£
¡¡¡¡ÎÒÃÇÖªµÀ£¬PHP¶ÁÈ¡MYSQL¶¯Ì¬ÏÔʾ£¬ÔÚ·ÃÎÊÁ¿´óµÄÇé¿öÏ£¬»áÓкܶàÐÔÄÜÎÊÌ⣬Èç¹û×âÓñðÈ˵ÄÐéÄâÖ÷»ú£¬Ôò»áÒòΪCPUÏûºÄ¹ý¶à¶ø±»ÏÞÖÆCPU£¬µ¼ÖÂÍø ......
<?php
/***************************
* Ò»¸ö·Ç³£ÊµÓøöÐԵķÖÒ³Àà *
****************************
*****************************ʵÀý***********************************
if(!isset($_GET['page'])){$page = 0;}else{$page = $_GET['page'];}
$pagedemo = new pageclass;
$pagedemo->set ......