Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2013
    Location
    Chaska, Minnesota
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts

    PHP dropdown menu

    How could I get this big chunk of html code into a PHP file ready to be inserted into a html document as a dropdown navigation menu?

    Code:
    <ul id="nav">
    
    <li><a href="index.html">Home</a>
    <li><a href="New Bridges.html ">New Bridges</a>
    <li><a href="Cool Bridges.html ">Cool Bridges</a></li>
    <li><a href="JMBPcontactpage.html ">Contact Me</a></li>
    <li><a href="Mission.html ">About This Site</a></li>
    <li><a href="Glossary.html ">Glossary</a></li>
    <ul>
    <li><a href="IL_COUNTIES ">Illinois Bridges</a>
    <ul class="scrollable">
    <li><a href="Jo Daviess County.html">Jo Daviess County</a></li>
    </ul>
    <li><a href="IA_COUNTIES ">Iowa Bridges</a>
    <ul class="scrollable">
    <li><a href="Dallas County.html">Dallas County</a></li>
    <li><a href="Emmet County.html">Emmet County</a></li>
    <li><a href="Floyd County.html">Floyd County</a></li>
    <li><a href="Hamilton County.html">Hamilton County</a></li>
    <li><a href="Polk County IA.html">Polk County</a></li>
    <li><a href="Webster County.html">Webster County</a></li>
    <li><a href="Wright County IA.html">Wright County</a></li>
    </ul>
    <li><a href="MN_COUNTIES ">Minnesota Bridges</a>
    <ul class="scrollable">
    <li><a href="Blue Earth County.html">Blue Earth County</a></li>
    <li><a href="Brown County.html">Brown County</a></li>
    <li><a href="Carver County.html">Carver County</a></li>
    <li><a href="Chippewa County.html">Chippewa County</a></li>
    <li><a href="Cottonwood  County.html">Cottonwood County</a></li>
    <li><a href="Dakota County.html">Dakota County</a></li>
    <li><a href="Grant County.html">Grant County</a></li>
    <li><a href="Hennepin County.html">Hennepin County</a></li>
    <li><a href="Jackson County.html">Jackson County</a></li>
    <li><a href="Le Seuer County.html">Le Seuer County</a></li>
    <li><a href="Lyon  County.html">Lyon County</a></li>
    <li><a href="McLeod County.html">McLeod County</a></li>
    <li><a href="Morrison County.html">Morrison County</a></li>
    <li><a href="Nicollet County.html">Nicollet County</a></li>
    <li><a href="Norman County.html">Norman County</a></li>
    <li><a href="Otter Tail County.html">Otter Tail County</a></li>
    <li><a href="Polk  County.html">Polk County</a></li>
    <li><a href="Ramsey County.html">Ramsey County</a></li>
    <li><a href="Redwood County.html">Redwood County</a></li>
    <li><a href="Renville County.html">Renville County</a></li>
    <li><a href="Rice County.html">Rice County</a></li>
    <li><a href="Scott County.html">Scott County</a></li>
    <li><a href="Stearns County.html">Stearns County</a></li>
    <li><a href="Steele County.html">Steele County</a></li>
    <li><a href="Wadena County.html">Wadena County</a></li>
    <li><a href="Waseca County.html">Waseca County</a></li>
    <li><a href="Washington County.html">Washington County</a></li>
    <li><a href="Yellow Medicine County.html">Yellow Medicine County</a></li>
    </ul>
    <li><a href="Grand Forks.html ">North Dakota Bridges</a>
    <ul class="scrollable">
    <li><a href="Grand Forks.html">Grand Forks Area</a></li>
    </ul>
    <li><a href="WI_COUNTIES ">Wisconsin Bridges</a>
    <ul class="scrollable">
    <li><a href="Chippewa County WI.html">Chippewa County</a></li>
    <li><a href="Dunn County.html">Dunn County</a></li>
    <li><a href="Eau Claire County.html">Eau Claire County</a></li>
    <li><a href="Polk County WI.html">Polk County</a></li>
    </ul>
    Thanks,
    John

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Place in file of any sort, and include it into your PHP script. Done and done.
    You don't need to do anything special with this since its just hard coded without any PHP. It could even be placed into a .txt file and included with include 'menu.txt';.

    Although if this were I, I'd either put that data into a database or a file, and then use PHP to actually create the list items.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •