All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
使用AJAX技术打造博客无刷新搜索引擎_[AJAX教程]
ASP.Net生成一个简单的图片_[Asp.Net教程]
Delphi项目的框架类-TApplication类实例-详解
C#,javascript,读写Cookie_[Asp.Net教程]
HTML语言剖析(十四)特殊字符_[Html教程]_0
程序设计中的三层架构_[Asp.Net教程]
使用c#捕获windows的关机事件_.net资料_编程技术
PHP将MYSQL内容读到二维数组并按指定列输出_[PHP教程]
XMLHTTP 对象及其方法简介_[XML教程]
asp.net用代码压缩服务器上文件夹或文件_[Asp.Net教程]
Reading number is top 10 pictures
做运动的校花2
汪峰的梦想
做运动的校花1
Terrorist smile the largest human history an explosion1
西游四格漫画(一)
在加油站厕所门口看到的告示
海底兵马俑
Summer is most suitable for young people to travel in China9
赵惟依写真1
沙漠里的美女
Download software ranking
Adobe Flash Player(IE) 10.0.32.18 浏览器专用的FLASH插件
Boxer vs Yellow4
Sora aoi‘s film--Lust fan wall
C#编程思想
Unix video tutorial2
天龙八部十二宫服务端
Ashlynn Video2
The cock of the Grosvenor LTD handsome
美女写真3
matrix2
aaa published in(发表于) 2013/12/24 5:54:56 Edit(编辑)
实例:PHP生成word文档格式试卷的代码_php资料_编程技术

实例:PHP生成word文档格式试卷的代码_php资料_编程技术

实例:PHP生成word文档格式试卷的代码_php资料_编程技术-你的首页-uuhomepage.com

PHP生成word文档的代码,这个是用来生产试卷的简单PHP代码


//初始化session
session_start();
// 包含数据库连接文件和头文件
?>





include('head.php');
require ('dbconnect.php');
?>
$juge=0;
for($i=1;($i<100);$i++)
{
$a=$i;
if(isset($_POST[$a]))
{
if($juge==0)
$sql.=" id=".$_POST[$a];
else
$sql.=" or id=".$_POST[$a];
$juge=1;
}
}
if($sql!="")
{
$sql="SELECT * FROM test WHERE".$sql;
$result_array=array(); //返回数组
$i=0; //数组下标
$query_result=@mysql_query($sql,$conn);
while($row=@mysql_fetch_object($query_result))
{
$i++;
$cout.=$i." ";
$cout.="题目难度:".$row->difficulty."
";
$cout.=" ".$row->content."

";
}//while

?>
class word
{
function start()
{
ob_start();
print'xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="'">http://www.w3.org/TR/REC-html40">';
}

function save($path)
{

print "";
$data = ob_get_contents();

ob_end_clean();

$this->wirtefile ($path,$data);
}

function wirtefile ($fn,$data)
{

$fp=fopen($fn,"wb");
fwrite($fp,$data);
fclose($fp);
}
}
/*-------word class End-------*/
$word=new word;
$word->start();
echo $cout;
$wordname="word/".time().".doc";
$word->save($wordname);//保存word并且结束.
?>

试卷已经生成,请点击这里查看
}
else
{
?>


您输入的条件不足,请重新输入!
}
?>












添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.