php+启动mysql_第一天 安装并启动php+mysql

simplyman's auto parts - order results

.blue {color:blue};

Bob's auto parts

Order results

echo '

Order processed at'. date('H:i, js F').'

';

//$tireqty;

//$_POST[_'tireqty']

//$HTTP_POST_VARS[ 'tireqty']

$tireqty = $_POST['tireqty'];

$oilqty = $_POST['oilqty'];

$sparkqty = $_POST['sparkqty'];

/*

echo '

Your order is as follows :

';

echo $tireqty. ' tires
';

echo $oilqty. ' oils
';

echo $sparkqty.' sparks
';

*/

//echo '$sparkqty sparks ';

/*

echo <<

line 1

line 2

line 3

theEnd

*/

$totalqty = 0;

$totalqty =$tireqty +$oilqty +$sparkqty;

if($tireqty <10){

$discount = 0;

}elseif(($tireqty >= 10) && ($tireqty <= 49)){

$discount = 5;

}elseif(($tireqty >= 50 )&&($tireqty <= 99)){

$discount = 10;

}elseif($tireqty >=100){

$discount = 15 ;

}

if($totalqty == 0):

echo '

';

echo "You didn't order anything on the previous page!
";

echo '

';

exit;

endif;

/*

if($totalqty == 0 ){

echo '

';

echo "You didn't order anything on the previous page!
";

echo '

';

exit;

} else {

if($tireqty > 0 )

echo $tireqty. ' tires
';

if($oilqty >0)

echo $oilqty. ' bottles of oils
';

if($sparkqty > 0)

echo $sparkqty.' sparks
';

}

*/

$find=$_POST['find'];

switch($find){

case 'a' :

echo "

Regular customer.

";

break;

case 'b':

echo "

Customer referred by TV advert.

";

break;

case "c":

echo "

cusomer referred by phone directory

";

break;

case "d":

echo "

Customer referred by word of mouth.

";

break;

default:

echo "

we do not know how this costmer found us.

";

break;

}

echo "Item ordered :".$totalqty."
";

$totalamount = (float)$totalqty ;

//$varname ='tireqty';

//$$varname= 5; $tireqty = 5';

define('TIREPRICE',100);

define('OILPRICE',10);

define('SPARKPRICE',4);

//echo TIREPRICE.' tireprice
';

$totalamount =0.00 ;

$totalamount = $tireqty * TIREPRICE

+ $oilqty * OILPRICE

+ $sparkqty * SPARKPRICE ;

echo "Subtotal :$" .number_format($totalamount,2)."
";

$taxrate = 0.10 ;//local sales tax is 10%

$totalamount = $totalamount * (1 + $taxrate);

echo "Total including tax :".number_format($totalamount,2)."
";

$a = 56 ; echo gettype($a).'
';

settype($a,'double');

echo gettype($a)."
";

echo 'isset($tireqty,$oilqty,$sparkqty):'.isset($tireqty,$oilqty,$sparkqty).'
';

echo 'isset($nothere):'.isset($nothere).'
';

echo 'empty($tireqty):'.empty($tireqty).'
';

echo 'empty($nothere):'.empty($nothere).'
';

?>

// here is a comment ?> here is not

echo "

Order processed

"

?>

echo date('H:i, jS F');

phpinfo();

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值