代码改变世界

用PHP制作网站之函数页代码

2013-10-08 21:36  F-lower  阅读(252)  评论(0编辑  收藏  举报

<?php

function box($x,$y)

{

echo"<script>alert ('".$x."');window.location='".$y."'</script>";

}

 

function fck ($name,$path,$width,$height,$value,$toolset)

{

            $fck=new FCKeditor($name);

$fck->BasePath=$path;

$fck->Width=$width;

$fck->Height=$height;

$fck->Value=$value;

$fck->ToolbarSet=$toolset;

$fck->Create();

}

function createfn()

{

date_default_timezone_set("PRC");

$tt=getdate(time());

$year=$tt["year"];

$month=$tt["mon"];

$day=$tt["mday"];

$hour=$tt["hours"];

$minute=$tt["minutes"];

$second=$tt["seconds"];

$fn=$year.$month.$day.$hour.$minute.$second;

return $fn;

}

function upfile()

{

for ($i=0;$i<=4;$i++)

{

if ($_FILES["file"]["size"][$i]>0)

{

$ext_name=strrchr($_FILES["file"]["name"][$i],".");

$fnnn=createfn().$i.$ext_name;

move_uploaded_file($_FILES["file"]["tmp_name"][$i],"img/".$fnnn);

$fnn=$fnnn.",".$fnn;

}

}

return $fnn;

}

?>

<a>家视野家具商城http://www.jiashiye.com</a>