drmy1050
drmy1050
2014-12-10 06:35

启用每个下拉项以链接到另一个页面

  • dreamweaver
  • php
  • html
  • drop-down-menu
已采纳

I want to enable each drop-down item to link to another page. but i dont know how to link it to another page. can someone help me please? this is for my project. im using php in dreamweaver.

<li class="current"><a href="location.php">Location</a>
                    <ul>

                        <li style="display: table-row"><a href="#">A</a></li>                           
                        <li style="display: table-row"><a href="#">B</a></li>
                        <li style="display: table-row"><a href="#">C</a></li>
                        <li style="display: table-row"><a href="#">D</a></li>
                        <li style="display: table-row"><a href="#">E</a></li>
                        <li style="display: table-row"><a href="#">F</a></li>
                    </ul>
                </li>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • duanpi7578 duanpi7578 7年前

    Link, meaning transfer its data through a form submission? If yes, you can retrieve the data from another page via $_GET and $_POST methods.

    page1.php

    <form method = "POST" action="page2.php"> // you may use GET
        <select name = "dropDown" required>
            <option value = "Sample Value">Sample Value</option>
            <option value = "Sample Value">Sample Value</option>
            <option value = "Sample Value">Sample Value</option>
        </select>
        <input type = "submit" name = "submitForm" value = "Submit Form">
    </form>
    

    page2.php

    <?php
    if(isset($_POST['submitForm']))
    {
       $displayData = $_POST['dropDown'];
       echo $displayData;
    }
    ?>
    

    Or you mean by link using "href", you can use

    <a href = "https://www.google.com/" target = "_blank">Link</a>
    

    Hope this helps you! :)

    点赞 评论 复制链接分享
  • doushi9444 doushi9444 7年前

    Maybe something like this can help you. I think you mean .php as in the extention filename??

    https://stackoverflow.com/a/12287729/4282030

    点赞 评论 复制链接分享

为你推荐