drema2014 2017-03-19 11:44
浏览 29
已采纳

如何用两个div标签制作echo表?

How to make echo for table with div ? Table do not work if I need to do echo.

My proposal with echo (not work):

<?php
    echo "<div class="container">
        <div class="main">
           <h2>User info</h2><hr/>
                <form id="form1" name="form1" method="post" action="input_form_02_qA_01.php">
                    <label>Name:<span>*</span></label><br />
                    <input type="text" name="nick" id="nick" placeholder="" required/>
                    <label>Email address:
                    <input type="text" name="email" id="email" placeholder="" required/>
                    </label>
                    <br/>
                    <label>Age:<span>*</span></label><br />
                    <input type="number" name="age" id="age" required/>
                    <label>Sex:<span>*</span></label><br />
                    <input type="radio" name="sex" value="man" required>Man
                    <input type="radio" name="sex" value="woman" required>Woman
                    <p>
                    <label>
                    <input type="submit" name="submit" id="Submit" value="Go to page 2" />
                    </label>
                </form>
        </div>
    </div>";
 ?>
  • 写回答

5条回答 默认 最新

  • dqrfdl5708 2017-03-19 11:47
    关注

    Just change the echo " to echo ' and at last "; to '; ?> Below code will work

    <?php
    echo '<div class="container">
        <div class="main">
           <h2>User info</h2><hr/>
                <form id="form1" name="form1" method="post" action="input_form_02_qA_01.php">
                    <label>Name:<span>*</span></label><br />
                    <input type="text" name="nick" id="nick" placeholder="" required/>
                    <label>Email address:
                    <input type="text" name="email" id="email" placeholder="" required/>
                    </label>
                    <br/>
                    <label>Age:<span>*</span></label><br />
                    <input type="number" name="age" id="age" required/>
                    <label>Sex:<span>*</span></label><br />
                    <input type="radio" name="sex" value="man" required>Man
                    <input type="radio" name="sex" value="woman" required>Woman
                    <p>
                    <label>
                    <input type="submit" name="submit" id="Submit" value="Go to page 2" />
                    </label>
                </form>
        </div>
    </div>';
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥20 sim800c模块 at指令及平台
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题