04 2013 档案
摘要:虽然很简单吧,但不试试还真不知道,一直在想怎么把程序取得的数据传入模板里?之前这么想的// data.php 文件$data = array( 'title'=>'ilsea', 'list'=>array( 'hello', 'world' ) );include('show.php');// show.php 模板文件<div> <?php echo $data['title']; echo '<br/>'; print_
阅读全文
摘要:今需要在页面下载文件,就找了个php的方法public function _downloads($path){ $filename = basename($path); $dirname = dirname($path); if(!file_exists($path)){ Header("Content-type: text/html; charset=utf-8"); echo "file $path does not exist"; exit(); }else{ ...
阅读全文
摘要:<script type="text/javascript">try{ ...some code...}catch(e){ ...some code... //处理错误 throw(e.name); //抛出异常}finally{ // 完成后执行的语句块,非必须}</script>javascript Error 对象: name: 错误名称 number: 错误号 description: 描述信息 message: 错误信息 fileName: 错误发生的文件 stack: 错误发生时的调用堆栈
阅读全文