SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2010
    0 Post(s)
    0 Thread(s)

    PHP includes not showing in page

    Hello - I am new to these forums, but I could really use some help with this problem.
    I have a menu that lists a bunch of items (unordered list). I need these items to appear (image and description) inside a specific div on my page, when they are chosen in the menu (clicked).

    The main page code is this :

    Code HTML4Strict:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "">
    	<title>Page Title</title>	
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <script src="menu.js" type="text/javascript"></script>
    <div id="container">
        <div id="topBar">
         <div class="innertext"><h1>Retail Display Fittings</h1>
          <img src="images/header1.jpg" />
         </div><!-- close innertext -->
        </div><!-- close topBar --> 
      <div id="leftMenu">
    	<?php include_once "menu.php"; ?>
    	  	<script type="text/javascript">
      </div><!--close leftMenu -->
    	  <div id="mainContent">
      	  <div class="clear"></div>
    	   <div id="interiorPages">
    	    <img src="images/showroom1.jpg" />
    <?php include_once "interior.php"; ?>
         </div><!-- close interiorPages -->
         <div class="clear"> </div>
      </div><!-- close mainContent -->
     <?php include_once "footer.php"; ?>	
     </div><!-- close container --> -->

    The code for interior.php (line 34 above) is this:
    Code PHP:
    	if(($id == "slatwall") && ($product == "slatwall")) {
    	else if(($id == "slatwall") && ($product == "1205")) {
    	else if(($id == "slatwall") && ($product == "1213")) {
    	else if(($id == "slatwall") && ($product == "1214")) {
    	else if(($id == "slatwall") && ($product == "1215")) {
    	else if(($id == "slatwall") && ($product == "2800")) {
    	else if(($id == "slatwall") && ($product == "2802")) {
     	else if(($id == "slatwall") && ($product == "2804")) {
    and so on...

    the code for the individual interior pages , e.g. 2804-hangrail-bracket.php is what I want displayed in the div:
    Code HTML4Strict:
       <p class="prod_img"><img src="../images/2804t.gif" /></p>
    <div class="clear"> </div>
       <h1 class="prod_name"> 2804 HANGRAIL BRACKET</h1>
       <p class="prod_desc"> 1&quot;&amp;1 1/16&quot;
            round tubing or<br>
            1 1/4&quot; &amp; 1 5/16&quot; round tubing<br>
            chrome only</p>
    <div class="clear"> </div>

    ALL the pages are saved as .php files.

    I cannot get the content to show in the div - and I am not getting any error messages, just nothing happens. All the files are in the same folder. And if I right-click on the menu they will open in a new page or tab, but they do not show in the same page in the div when the menu is clicked.

    I hope I have been clear - I am fairly new to PHP and I'm sure there is a silly error somewhere in the code but I can't find it. I've been searching, reading tutorials and forums for over a week now, can't solve this.

    Thanks for any help,

  2. #2
    SitePoint Zealot Cute Tink's Avatar
    Join Date
    Apr 2009
    0 Post(s)
    0 Thread(s)
    Have you tried to echo or print the values of $_GET['id'] or $_GET['product'] to make sure they are equivalent to what you are checking for?

    You don't have an ultimate else{} option, so if they don't match what you are looking for, nothing is going to show up.

  3. #3
    SitePoint Member
    Join Date
    Jul 2010
    0 Post(s)
    0 Thread(s)
    I am pretty sure the content is equivalent, because when I right-click on the menu they will load into a new tab or page - they just don't load into the page where I want them.
    I'll try an echo for an error messasge for empty values and see what i get...

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts