How do I apply my php code to a bootstrap code?

I am trying to display something from my database on a bootstrap bar and I have no idea how to combine or implement the two. Ive made my bootstrap html's file a .php, was that the correct thing to do? Here's my code (ignore the filler words)

<ul class="nav nav-list well">

        <li class="nav-header"></li>
        <li class="active"><a href="#">HIT INFO</a></li>
        <li><a href="#">Linky link</a></li>
        <li class="divider"></li>
        <li><a href="#">ANOTHER HIT INFO</a></li>
        <li><a href="#">ANOTHER LINKY LINK</a></li>
        <li class="divider"></li>
        <li><a href="#">YET ANOTHER HIT</a></li>
        <li><a href="#">AAAAAnd another link</a></li>

    </ul>

and this is the php i want to include (the code to making what i want to display is in the file)

<?php include 'one.php'; ?>

where "linky link" is, i want to display this but it didnt seem to work when i put that php right there. Another thing i want to do is when a link from the database gets displayed, it displays as a bootstrap button. i tried and am just not sure how to implement php code in my bootstrap code.

Print " <td>".$row['link'] . "</td></tr> ";

How would i add this bootstrap code to that so when a link from my database gets displayed, it gets displayed as this button

<a href="#"  class="btn btn-primary btn-large"><i class="icon-heart icon-white"></i>Do this HIT!</a>

Answers


Your code seems right to me except to your "<td> and <tr>" tag. You're not using it right. Try this approach

In one.php

<?php 

$links = array( 0 => array("url"=>"http://google.com","text"=>"Google") );

?>

In Menu

<?php include('one.php')?>
<ul>
<li><a href="">Menu one</a></li>
<?php foreach( $links as $link){ ?>
<li><a href="<?php print $link['url']?>"><?php print $link['text']?></li>
<?php } ?>
</ul>

Need Your Help

JQuery - also trigger change on click away

javascript jquery

I have a basic JQuery script that changes a few divs when you click - thus showing them - via toggle.

How to disable a href

javascript php jquery mysqli

How to disable a href link if there's value in PR row from database? Like my sample table below, if there PR disable the link.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.