site/product_view.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php include('header.php');
if(isset($_GET['init']))
{
$_GET['id']=$_GET['init'];
}

$sql = 'SELECT * FROM products WHERE id='.$_GET['id'];
$product = $db->execute_dql($sql);
$product = $product[0];
$pro = $product;


$sql = 'SELECT * FROM photo WHERE pid='.$pro['id'];
$ps = $db->execute_dql($sql);


$sql = 'SELECT * FROM comment WHERE mid='.$pro['id'];
$cs = $db->execute_dql($sql);

			if(!empty($cs)){
			foreach($cs as $i=>$c)
			{
				$sql = 'SELECT * FROM members WHERE id='.$c['uid'];
				$u = $db->execute_dql($sql);
				$cs[$i]['user'] = $u[0];
			}
			}
if($_POST)
{
	if(empty($_SESSION['username']))
	{
		echo '<script>';
		echo 'alert("请您先登录");';
		echo 'window.history.back(-1);';
		echo '</script>';
		exit;
	}
	$sql = 'INSERT INTO comment(mid,uid,content,created) VALUES(
	"'.$_POST['id'].'","'.$_SESSION['userid'].'","'.$_POST['content'].'",'.time().');';
	$db->execute_dml($sql);
	echo '<script>';
    echo 'alert("评论成功!~");';
    echo 'window.history.back(-1);';
    echo '</script>';
    exit;
}

?>

<div class="row">
    <div class="shop-detail xzt-wp box">


        <div class="product-name">
            <a href="#">商城中心</a>
            &gt;
            <a href="#"><?php echo $product['product_name'];?></a>
        </div>

        <div class="product-image">
后面还有 150 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。