0

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>
barbarian
  • 3
  • 3

2 Answers2

0

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! :)

cartmander
  • 172
  • 1
  • 4
  • 13
0

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

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

Community
  • 1
  • 1
xtrman
  • 421
  • 3
  • 14