How do I integrate bootstrap into a php project in Dreamweaver cs5.5?

Asked

Viewed 1,267 times

1

I’m having trouble integrating bootstrap into Dreamweaver. For better insight, I’ll post the code.

header.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>CRUD EM PHP COM PDO OOP USANDO BOOTSTRAP</title>
	<link href="bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" media="screen>
</head>

<body>
	<div class="navbar navbar-default navbar-static-top" role="navigation">
    <div class="container">
 
        <div class="navbar-header">
            <a class="navbar-brand" href="http://www.codingcage.com" title='Programming Blog'>Coding Cage</a>
            <a class="navbar-brand" href="http://www.codingcage.com/search/label/CRUD">CRUD</a>
            <a class="navbar-brand" href="http://www.codingcage.com/search/label/PDO">PDO</a>
            <a class="navbar-brand" href="http://www.codingcage.com/search/label/jQuery">jQuery</a>
        </div>
 
    </div>
</div>

footer.php:

<div class="container">
 <div class="alert alert-info">
    <strong>tutorial !</strong> <a href="http://www.codingcage.com/">Coding Cage</a>!
 </div>
</div>
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>

dbconfig.php:

<?php
    $DB_host = "localhost";
    $DB_user = "root";
    $DB_pass = "";
    $DB_name = "dbpdo";

    try
    {
        $DB_con = new PDO("mysql:host{$DB_host}; dbname={$DB_name}",$DB_user,$DB_pass);
        $DB_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    }
    catch (PDOException $e)
    {
        echo $e->getMessage();
    }

    include_once 'class.crud.php';
    $crud = new crud($DB_con); 
?>

index php.

<?php include_once 'dbconfig.php'; ?>
    <?php include_once 'header.php'; ?>

    <div class="clearfix"></div>

    <div class="container">
        <a href="add-data.php" class="btn btn-large btn-info"><i class="glyphicon glyphicon-plus"></i> &nbsp; Gravar</a>
    </div><!--container-->

    <div class="clearfix"></div><br />

    <div class="container">
        <table class='table table-border table-responsive'>
            <tr>
                <th>#</th>
                <th>Nome</th>
                <th>Sobrenome</th>
                <th>Email</th>
                <th>Telefone</th>
                <th colspan="2" align="center">Ação</th>            
            </tr>
            <?php
                $query="SELECT * FROM tbl_usuarios";
                $record_per_page=3;
                $newquery=$crud->paging($query,$records_per_page);
                $crud->dataview($newquery);
            ?>
            <tr>
                <td colspan="7" align="center">
                    <div class="pagination-wrap">
                        <?php $crud->paginglink($query,$record_per_page); ?>

                    </div><!--pagination-wrap-->                
                </td>
            </tr>

        </table>

    </div><!--container-->

    <?php include_once 'footer.php';?>

As a result I have it:

inserir a descrição da imagem aqui

  • 1

    I think there may be some problem in the fact that you are instantiating the variable $record_per_page=3 and moving to the function in the next row another variable $records_per_page. Try removing’s' from the second to see if it works.

  • The problem is it doesn’t even bring the bootstrap tricks.

  • Look in the browser console if the bootstrap call is not returning 404. It may be that the path is incorrect. Check it out.

  • How do I do that? I’m still new to web programming.

  • With the page open, press F12 or right-click anywhere on the page > Inspect element. After that you will open a window with several tabs. Click 'Console' and reload the page. See if there will be any error notification of similar [HTTP/1.1 404 Not Found ...]. Or, click on the Network tab, you’ll see all the requests your page is making and see if the bootstrap reference does not appear with code 404.

  • Okay. Error 404 has appeared. What should I do?

  • So, now that we know it’s path problem up to the Bootstrap files, you’ll need to put links of references pointing to the right place. Read better about relative paths here. After fixing the path. Bootstrap should appear normally. Another possibility is to use the bootstrap CDN, which cuts the need to put it in your directory tree, read more here

  • I already did both ways, downloaded the bootstrap again from the link you gave me, copied the CDN link, neither way it worked. As for the normal path, in Dreamweaver when I type "href link", I click on "Browse" and put the referred file.

  • I was able to create a new document with the structure of html 5.

  • Glad you made it!

  • Very happy. Thank you brother!

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.