易截截图软件、单文件、免安装、纯绿色、仅160KB

php生成word文档,并可以下载

<?php
if($_POST['str'])
{
header('Content-type: application/doc');
header('Content-Disposition: attachment; filename="downloaded.doc"');
echo iconv("UTF-8","GB2312",$_POST['str']);
}
?>
<a href="javascript:void(0)" onclick="downword()">下载</a>
<div id="word" style="display:none">加息预期下银行再推固息房贷
</div>
<form action="" method="POST" name="form">
<textarea style="display:none" name="str"  id="down"/></textarea>
</form>
<script>
function downword()
{
 var doc=document.getElementById("word").innerHTML;
 document.getElementById("down").value=doc;
 document.form.submit();
}
</script>
如果想生成其它的文件,将doc改成其它的扩展名就OK了


相关文档:

php表格(test)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <style type = "text/css">
        &nbs ......

PHP 中长连接的实现

  每次我们访问 PHP 脚本的时候,都是当所有的PHP脚本执行完成后,我们才得到返回结果。如果我们需要一个脚本持续的运行,那么我们就要通过 PHP 长连接的方式,来达到运行目的。
  每个 PHP 脚本都限制了执行时间,所以我们需要通过 set_time_limit 来设置一个脚本的执行时间为无限长;然后使用 flush() 和 ob_flush() ......

[PHP]PDO调用存储过程

1. 数据库中已创建存储过程user_logon_check, PHP调用示例如下,
<?php
$dsn = 'mssql:dbname=MyDbName;host=localhost';
$user = 'sa';
$password = '666666';
try {
$dbCon = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
print 'Connection failed: '.$e->getMessage();
......

[PHP]Smarty的使用

<?php
define('SMARTY_TMP_DIR','C:/php5/Smarty-2.6.13/');
define('SMARTY_DIR','C:/php5/Smarty-2.6.13/libs/'); //SMARTY_DIR ->smarty keyword,must be defined as libs dectory
require_once(SMARTY_DIR.'Smarty.class.php');
//建立一个smarty对象
$smarty = new Smarty;
$smarty->template_dir = ......

php的simpletest框架对uchome项目进行接口测试脚本

<?php
require_once ('unit_tester.php');
require_once ('reporter.php');
require_once ('../config.php');
require_once ('../source\modules\user\user_api.func.php');
require_once ('../source/base_model.class.php');
Class registertest extends UnitTestCase{
public function testAssertEqual(){
$b ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号