A
A
Alex Alex2015-09-07 09:30:20
css
Alex Alex, 2015-09-07 09:30:20

Where to put the modal window?

function Menu(){
if ($_SESSION['USER_LOGIN_IN'] !=1) 
$memu ='<form action="" class="navbar-form navbar-right">
     <a href="modal-1" class="btn btn-danger" data-toggle="modal" data-target="#modal-1">Войти</a>
    </form>';
else $memu ='<ul class="nav navbar-nav">
      <li><a href="instagram">Инстаграм</a></li>
            <li><a href="profile">Профиль</a></li>
          </ul>';
echo '<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/">KatKat Project</a>
        </div>
        <div class="collapse navbar-collapse">
          '.$memu.'
        </div>
      </div>
    </div>';
}
?>

I display the menu with this function, on the page. I write the current:
<?php Menu ()
;?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Alex, 2015-09-07
@GoldenEagle88

Modal window:

<div class="modal fade" id="modal-1">
    <div class="modal-dialog">
    <div class="modal-content">
    <div class="modal-header">
    <button class="close" type="button" data-dismiss="modal"><i class="glyphicon glyphicon-remove-sign"></i></button> 
    <h4 class="modal-title">Войти</h4> 
    </div>
    <div class="modal-body">
    <div class="container">
    <div class="row">
    <div class="col-md-3">
    <img src="img/кот.jpg" class="img-responsive" >
    </div> 
    <div class="col-md-8">
    <form action="" class="navbar-form">
    <div class="form-group">
    <input type="text" class="form-control" placeholder="Логин" value=""> 
    <p></p>
    <input type="password" class="form-control" placeholder="Пароль" value="">
    </form>


    <a href="#" class="btn btn-danger">Войти</a> 
    <a href="#" class="btn btn-danger" data-toggle="modal" data-target="#modal-2">У меня нет аккаунта</a>
    </div> 
    </div>
    </div> 
    </div>
    <div class="modal-footer">

    </div>
    </div>
    </div>
    </div>
    </div>

Main page :
<?php Head('Главная Страница');?>
  <body>
    <?php Menu();?>
  <?php MessageShow();?>
    <div class="container" style="margin-top: 50px">
      <div class="starter-template" style="padding: 40px 15px; text-align: center; ">
        <h1>Добро пожаловать на мой сайт</h1>
      </div>
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="resource/bootstrap.js"></script>
  <script type="text/javascript" src="resource/instafeed.min.js"></script>
    <script type="text/javascript" src="resource/app.js"></script>
  </body>
</html>

Menu :
function Menu(){
if ($_SESSION['USER_LOGIN_IN'] !=1) 
$memu ='<form action="" class="navbar-form navbar-right">
     <a href="modal-1" class="btn btn-danger" data-toggle="modal" data-target="#modal-1">Войти</a>
    </form>';
else $memu ='<ul class="nav navbar-nav">
      <li><a href="instagram">Инстаграм</a></li>
            <li><a href="profile">Профиль</a></li>
          </ul>';
echo '<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/">KatKat Project</a>
        </div>
        <div class="collapse navbar-collapse">
          '.$memu.'
        </div>
      </div>
    </div>';
}

D
dake1231, 2015-09-07
@dake1231

<div id="modal">
<?php Menu() ?>
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question