2014级PHP程序设计
2016-2-23 14:43
请先登录。
<h1>计算商品价格</h1>
<?php
function goodsPrice($a,$b){
if($b == '至尊'){
$a = $a * 0.75;
return $a;...
<h1>登录设置</h1>
<?php
function userSign($userName,$passWord){
if(strle...
<h1>司龄补助</h1>
<?php
function workYear($entryAge){
$now = time ();
date_default_timezone_set("PRC"...
<?php
/*
*入职第1年,司龄补助为50元,
*入职第2年,司龄补助为100元,
*入职3年,司龄补助为150元,
*依次类推,每位员工的司龄补助最多为600元。
*/
echo "<h1>任务3-1司龄补助计算</h1>";
echo ...
<?php
/*
* 功能:用户登录功能实现
* 参数:$name用户名,$passWord密码
* 返回值:md5加密方式加密后的值
* */
function userLogin($name,$passWord){
if (strlen($na...
<?php
/*
* 功能:司龄补助计算
* 参数:&inYear入职年份
* 返回值:司龄补助金额
* */
function companyHelp($inYear){
$time=time();
$allYear=date('Y...
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
/**
*参数 商品原价 会员类别
*至尊会员 75折
...
<?php
function jiage($price,$class)
{
echo '商品原价为5000','<br/>';
if($class == 1)
{$pric...
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
/**
*参数$name,$password
*用户名长度小于4,结束函数执行“...
1.代码:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<h1>商品的价格</h1>
<?php
function Disco...
<h1>用户名登录</h1>
<?php
header("Content-type: text/html; charset=utf-8");
function l($username,$password)
{
if(...
1.代码:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<h1>用户登录</h1>
<?php
function Login(...
完
完
<meta http-equiv="Content-Type" charset="utf-8"/>
<h2>作业一:司龄补助</h2>
<?php
function ageAllowance($hiredate)
{...
<meta http-equiv="Content-Type" charset="utf-8"/>
<h2>作业二:用户登录</h2>
<?php
function formCheck($username,$password...
<meta http-equiv="Content-Type" charset="utf-8"/>
<h2>作业三:计算商品价格</h2>
<?php
function priceChange($buyerRank,$pr...
1.代码:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
echo '当前时间为:';
echo date('Y年');
echo '<...
<h1>司龄工资</h1>
<?php
header("Content-type: text/html; charset=utf-8");
function allowance($years)
{
$time = t...
<?php
function people($price,$type)
{
switch($type)
{
case "至尊会员":
$money=$price*0.75;
echo "计算后的商品价格:";
echo $money;
...
<?php
function input($name,$password)
{
if(strlen($name)<4)
{
echo "用户名长度不够";
echo "<br/>";
return ;
}
else if(strl...
<meta http-equiv="Content-Type" charset="utf-8"/>
<h1>the third work - 用户登录</h1>
<?php
/**
*用户登录功能实现
*/
function Che...
<?php
function discount($members,$price){
switch ($members) {
case '0':
echo "您不是会员所以您的商品价格为".$price;
echo "</br>...
<?php
function salary($year)
{
$time=time();
date_default_timezone_set("PRC");
echo "当前年份:";
$nowTime=date('Y',$time);...
<?php
function theDiscount($level,$price){
echo '原价:';
echo $price;
echo "<br/>";
switch ($level) {
case...
<?php
function login($username,$password){
if (strlen($username) <= 4) {
echo "用户名长度不够";
echo "</br>";
return;
...
代码:
<?php
echo "现在时间";
echo date('Y年m月d日',time("PRC"));
echo "</br>";
function Department($year){
$time1=date('Y',time("P...
<?php
//$input = "Hello,PHP World!";
//$output = md5($input);md5加密方式
function theLogin($account,$password){
$name=strlen($account)...
<?php
function discount($original,$member){
switch ($member)
{
case "至尊会员":
global $money;
$money=$or...
<?php
header("Content-type: text/html; charset=utf-8");
function price($vip,$price){
switch ($vip) {
case ...