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

Reading number is top 10 articles
C#操作MySQL中文乱码的解决方案_[Asp.Net教程]
C#网络应用编程基础练习题与答案(二)_[Asp.Net教程]
ASP.net,做的IP,访问限制_[Asp.Net教程]
动态控件添加终极解决方案_[Asp.Net教程]
漫谈Ajax在ASP.Net中的使用_[Asp.Net教程]
5款纯div+css制作的弹出菜单(标准且无js)_[Html教程]_0
[delphi语法4]delphi中if语句的使用实例
理解动态网页技术PHP与数组的应用_php资料_编程技术
C#入门代码_[Asp.Net教程]
用iframe自动适应高度_[Html教程]
Reading number is top 10 pictures
原子弹轰炸长崎的珍贵照片
A man's favorite things6
Chinese paper-cut grilles art appreciation1
Summer is most suitable for young people to travel in China8
XuRe xuan cool and refreshing photoes1
The money of more than 100 countries and regions20
Household design of gorgeous series
2012 national geographic daily picture8
身材野火台灣美女1
The money of more than 100 countries and regions14
Download software ranking
SQL2000 For 4IN1
Detective task-the top secret prostitution files
Jinling thirteen stock
Unix video tutorial1
Proficient in JavaScript
Tram sex maniac 2 (H) rar bag19
超级战舰
少妇苏霞全本
豪门浪荡史
Desire a peach blossom
aaa published in(发表于) 2013/12/24 5:50:46 Edit(编辑)
PHP教程实例:用PHP脚本生成word文档的程序_php资料_编程技术

PHP教程实例:用PHP脚本生成word文档的程序_php资料_编程技术

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.