php条件语句(混合php的if语句和js编程)

<?php if (isset($_SESSION['account']) && $_SESSION['account'] !== null && isset($_SESSION['uid']) && $_SESSION['uid'] !== null): ?>
                var d = dialog({
                    title: "收藏状态",
                    content: `
                        <input type='radio'>想看
                        <input type='radio'>看过
                        <input type='radio'>在看
                        <input type='radio'>抛弃
                        <input type='radio'>搁置
                        <button onclick='addCollect()'>保存</button>`
                    })
                d.show();
            <?php else: ?>
                var d = dialog({
                    title: "提示",
                    content: "请先登录"
                    })
                d.show();
            <?php endif; ?>
        }

 

posted on 2026-02-20 19:19  小沙盒工作室  阅读(11)  评论(0)    收藏  举报