$get_contents = iconv('gbk', 'utf-8', $get_contents); //将获取的网页转换成UTF-8编码,若文件为GBK编码可去掉本行 preg_match("/URL=(\S+)'>/s", $get_contents, $out); //获取跳转后URL $real_link = 'http://baike.baidu.com' . $out[1]; //echo $real_link; //输出 http://baike.baidu.com/view/1466380.htm <iframe src="<?php echo $real_link; ?>" width="100%" height="1000"> 互动百科搜索结果 </iframe> * */ ?> </div> </div> </div> <div class="span4"> <div class ="well"> <?php render_entity($dbc, $keywords); echo '<a class="btn btn-primary" href="entity.php?name=' . $keywords . '"><i class="icon-edit icon-white"></i> 编辑</a>'; ?> </div> </div> </div> </div> </div> <?php include_once "./foot.php";
include_once "./functions.php"; require_once 'appvars.php'; require_once 'connectvars.php'; $id = $_GET["id"]; $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); /* $query = "SELECT def FROM def WHERE name = '$id'"; //echo $query; $result = mysqli_query($dbc, $query) or die('Error querying database1.'); if ($row = mysqli_fetch_array($result)) { $def = $row['def']; $hint = "<p><strong>$id</strong>,".$def."</p>"; } if ($hint == "") { $response = "无相关概念信息!"; } else { $response = $hint; } //output the response echo $response; * */ render_entity($dbc, $id, $edit = false); echo '<a class="btn btn-success" href="search.php?keywords=' . $id . '">查看详情</a>'; ?>
render_warning('实体信息添加成功!'); } else { render_warning('请补全实体信息!'); } } else { render_warning('无相关实体信息!'); } } } if (isset($name) && $name != '') { ?> <div class="container"> <div class ="well"> <?php render_entity($dbc, $name, true); ?> </div> <div class ="well"> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post" class="form-horizontal" enctype="multipart/form-data"> <legend>请添加实体信息:</legend> <input type="hidden" id="name" name="name" value = "<?php echo $name; ?> " > <div class="control-group">