Jump to content
Larry Ullman's Book Forums

Quick Confirmation Of Correct Settings For Base_Uri And Base_Url


Recommended Posts

I am finalizing the coding from Chapter 3 and cannot get the Account and Admin drop downs to display properly.

 

One possible cause may be that I haven't correctly configured the BASE_URI and BASE_URL settings in the config file.

 

Is there a quick way to check to see that I have configured these properly?  

 

Note: I can successfully connect to the DB, and the $_SESSION['user_id'] is set.

 

Thanks! 

Link to comment
Share on other sites

Hello Lindsd1111,

 

 

i see that you have some problem with the dropdown menus. Html structure ?

 

so perhaps, this is the extract  of the header.inc.html. This can help you IF you use the 

 Offcanvas ' bootstrap thème

 

good work David

<body class="<?php if(isset($page_title)){ echo str_replace(' ','_',$page_title);  }else{  echo '';  }?> ">
      <div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
        <div class="container-fluid">
          
          <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="index.php"><img src="../i/logoOR-10.png" alt="recipe" /><b>Recipe</b></a>
          </div>
          
          <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
             <?php
            	$pages = array(
            	 'HOME'=>'index.php',
            	 'REGISTER'=>'register.php',
            	 'LOGIN'=>'login.php'
            	 );
             
             $this_page = basename($_SERVER['PHP_SELF']);
             foreach($pages as $key =>$value){
             echo '<li';
             		if($this_page == $value) echo ' class="active"';
             		echo '><a href="'.$value.'">'.$key.'</a></li>';
             		}//endF
             	
             	if(isset($_SESSION['user_id'])){
             		echo '<li class="dropdown">
             			<a href="#" class="dropdown-toggle" data-toggle="dropdown">STATUT<b class="caret"></b></a>
             				<ul class="dropdown-menu">
             					<li><a href="logout.php">Logout</a></li>
             					<li><a href="renew.php">ReNew</a></li>
             					<li><a href="change_password.php">Change psw</a></li>
             					
             				</ul>
             			</li>';
             			
             	//if(isset($_SESSION['user_admin'])){
             	if(isset($_SESSION['user_member']) ){
             		echo '<li class="dropdown">
             			<a href="#" class="dropdown-toggle" data-toggle="dropdown">VOTRE ESPACE <b class="caret"></b></a>
             				<ul class="dropdown-menu">
             					<li><a href="author_list_page.php">Liste de vos recettes</a></li>
             					<li><a href="add_page.php">Ajouter une recette</a></li>
             					<li><a href="favorites.php">Favoris</a></li>
             					<li><a href="history.php">Historiques</a></li>
             					
             				</ul>
             			</li>';
             	}
              
              if(isset($_SESSION['user_admin'])){
              	echo '<li class="dropdown">
              		<a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin<b class="caret"></b></a>
              			<ul class="dropdown-menu">
              				<li><a href="ad_list_member.php">Liste des membres</a></li>
              				<li><a href="ad_list_page.php">Liste recette</a></li>
              				<li><a href="ad_edit_page.php">Ajouter une recette</a></li>
              			</ul>
              		</li>';
              }
              
             	             	             			
              }?>
             
              </ul>
               <!--search-->
	              <form class="navbar-form pull-right" role="search" >
	              	<div class="form-group">
	                <input type="text" class="form-control input-medium search-query" placeholder="Search">
	                </div>
	                <button type="submit" class="btn btn-default">Search</button>
	              </form>
	      </div><!-- /.nav-collapse -->
        </div><!-- /.container -->
      </div><!-- /.navbar -->

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...