session_start(); require("init.php"); $id = (int)$_GET["id"]; $result = trim($_GET["result"]); if ($id < 1) { $db->close(); header("location: default.php"); exit; } $sql = "select a.title,a.source,a.class_id,a.content,a.create_time,a.views,a.author,a.pic,a.annex,a.mtbh,a.price,a.tfzq,a.tfsj,a.userid,a.city,a.title2,a.author, b.name,b.content as bh from info a left join info_class b on a.class_id=b.id where a.id=$id and a.state>0 limit 1"; //echo $sql;exit; $rst = $db->query($sql); if ($row = $db->fetch_array($rst)) { $title = $row["title"]; $source = $row["source"]; $class_id = $row["class_id"]; $_three = substr($row["class_id"],0,3);//pierce add $content = $row["content"]; $create_time = $row["create_time"]; $publishdate = explode(' ', $create_time); $views = $row['views']; $author = $row['author']; $pic = $row['pic']; $annex = $row['annex']; $share = $row['share']; $mtbh = $row['mtbh']; $price = $row['price']; $tfzq = $row['tfzq']; $tfsj = $row['tfsj']; $userid = $row['userid']; $city = $row['city']; $title2 = $row['title2']; $author = $row['author']; $bh = $row['bh']; $sql = "update info set views=views+1 where id=$id"; $db->query($sql); } else { $db->close(); header("location: default.php"); exit; } $base_id = substr($class_id, 0, 3); if ( strlen($class_id) == 3 ) { // 只有base_id,默认第一个子栏目ID $base_id = substr($class_id, 0, 3); $second_id = ''; $third_id = ''; $base_name = $db->getTableFieldValue('info_class', 'name', 'where id=\'' . $base_id . '\' limit 1'); $second_name = ''; $third_name = ''; } elseif ( strlen($class_id) == 6 ) { $base_id = substr($class_id, 0, 3); $second_id = substr($class_id, 0, 6); $third_id = ''; $base_name = $db->getTableFieldValue('info_class', 'name', 'where id=\'' . $base_id . '\' limit 1'); $second_name = $db->getTableFieldValue('info_class', 'name', 'where id=\'' . $second_id . '\' limit 1'); $third_name = ''; } elseif ( strlen($class_id) == 9 ) { $base_id = substr($class_id, 0, 3); $second_id = substr($class_id, 0, 6); $third_id = substr($class_id, 0, 9); $base_name = $db->getTableFieldValue('info_class', 'name', 'where id=\'' . $base_id . '\' limit 1'); $second_name = $db->getTableFieldValue('info_class', 'name', 'where id=\'' . $second_id . '\' limit 1'); $third_name = $db->getTableFieldValue('info_class', 'name', 'where id=\'' . $third_id . '\' limit 1'); } ?> if ($_SERVER['REQUEST_METHOD'] == "POST") { $sortnum = $db->getMax("message", "sortnum") + 10; $name = htmlspecialchars(trim($_POST["name"])); $phone = htmlspecialchars(trim($_POST["phone"])); $email = htmlspecialchars(trim($_POST["email"])); $useridx = trim($_POST["userid"]); $fax = ''; $company = ''; $content = htmlspecialchars(trim($_POST["content"])); $ip = $_SERVER['REMOTE_ADDR']; if (empty($name) || empty($phone) || empty($content)) { $db->close(); header("location: mtzy_display.php?id=$id&result=0"); exit; } $sql = "insert into message(sortnum, name, phone, email, fax, company, content, create_time, ip, state,userid) values ($sortnum, '$name', '$phone', '$email', '$fax', '$company', '$content', '" . date("Y-m-d H:i:s") . "', '$ip', 0,$useridx)"; if ($db->query($sql)) { $db->close(); header("location: mtzy_display.php?id=$id&result=1"); exit; } else { $db->close(); header("location: mtzy_display.php?id=$id&result=0"); exit; } } ?>
发布时间: 收藏
未认证
}else{ ?>已认证
} } ?>媒体编号:
0万/
所在地区 | 区域属性 | 媒体形式 | |||
投放周期 | 媒体编号 | 投放价格 | 0万 | ||
媒体规格 | |||||
媒体环境/描述 |