Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About php4me

  • Rank
  1. Hi, I fixed the error but the page layout is gone, so I had to reupload the header file, I am trying to get the same template as shown in the book but I can't get rid of the drobdown top menu to make the links appear at the top. Thanks
  2. Hi, I am not sure if I understand this right, if I want to use the same template you're using in the book, then the header page completly changes from the code in the download to the code in the book? Here is the code that I put from the book, but it gives me error when I view the site. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <title><?php // Use a default page title if one wasn't provided... if (isset($page_title)) { echo $page_title; } else { echo 'Virtual Script'; } ?></title> <!-- Bootstrap core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/sticky-footer-navbar.css" rel="stylesheet"> </head> <body> <?php // <!-- Wrap all page content here --> $page = array ( 'Home' => 'index.php', 'About' => 'about.php', 'Contact' => 'contact.php', 'Register' => 'register.php' ); $this_page = basename($_SERVER['PHP_SELF']); foreach ($page as $k => $v) { echo '<li'; if ($this_page = $v) echo ' class="active"'; echo '><a href="' . $v . '">' . $k . '</a></li>'; } // END OF FOREACH LOOP. if (isset($_SESSION['user_id'])) { echo '<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Account <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 Password</a></li> <li><a href="favorites.php">Favorites</a></li> <li><a href="recommendations.php">Recommendations</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="add_page.php">Add Page</a></li> <li><a href="add_pdf.php">Add PDF</a></li> <li><a href="#">Something else here</a></li> </ul> </li>'; } ?> <?php $q = 'SELECT * FROM categories ORDER BY categories'; $r = mysqli_query($dbc, $q); while (list($id, $category) = mysqli_fetch_array($r, MYSQLI_NUM)) { echo '<a href="category.php?id=' . $id . '" class="list-group-item="' . $category . '">' . htmlspecialchars($category) . '</a>'; } ?> <?php if (!isset($_SESSION['user_id'])) { require('includes/login_form.inc.php'); } ?> <div class="col-9"> <!-- CONTENT --> </html> Thanks very much.
  3. Hi, I have just started with this book by preparing the files & folders on my server, but after doing so, When I compared them to the files and folders from the download, there are some differences in the js folder in the book it should be one file only which is "bootstrap.min.js" instead there are the following files "favorite, notes and folder tinymce", I am in ex1, Help please Thank
  4. Hi, I have a question please, what are the differences between the files in the includes folder, themes and the main files? eg: the templates files contains the main layout of the pages, but what about the other files. Thanks Terraza
  • Create New...