SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    arizona
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php script keeps repeating code above it???

    Im using a simple php script to load another file into my page. The problem is, It gets to the php script and just keeps repeating the code before it.

    www.flathollowmarina.com/zexperiment.php

    This is my primary page

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Flat Hollow Marina and Resort on Norris Lake, Tennessee</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="stylesheetrental.css" rel="stylesheet" type="text/css">
    </head>
    
    <body bgcolor="#006666">
    <div align="center">
    <?php include('navbar/navbar.php'); ?>
    
    
    <table width="706" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="index/frontpic.jpg" width="706" height="324"></td>
        </tr>
      </table>
    </div>
    </body>
    </html>
    here is my php file that Im loading into the primary page. Why does it keep repeating???????

    Code:
    <body>
    <div align="center">
        <table width="750" class="conloc">
          <tr>
            <td align="right">&gt;&gt; <a href="../index.html">Home</a> &gt;&gt; <a href="../location.html">Location</a> 
              &gt;&gt; <a href="../contact.html">Contact Us</a></td>
          </tr>
        </table>
        
    	<table class="navbar" width="750" height="32"border="0" cellpadding="0" cellspacing="0" background="navbar.gif">
          <tr> 
            <td width="10"></td>
            <td align="center"><a href="../rentals-main.html">Rental Properties</a></td>
            <td><div align="center"><a href="../new_houseboats.html">Houseboat Rentals</a></div></td>
            <td><div align="center"><a href="../rates.html">Rates</a></div></td>
            <td><div align="center"><a href="../services.html">Service & Amentities</a></div></td>
            <td><div align="center"><a href="../it%27sallnew.html">It's All New</a></div></td>
            <td><div align="center">General Info</div></td>
            <td width="15"></td>
          </tr>
        </table>
      
      
    </div>
    </body>
    </html>
    Thanks for your help.

  2. #2
    SitePoint Evangelist LemoNade's Avatar
    Join Date
    Aug 2005
    Location
    Southampton, UK
    Posts
    500
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try taking out the <body> and <html> tags from navbar.php - They aren't needed as you are including navbar.php into a page which is already enclosed in those tags.

    Worth a try, can't see why its repeating though.

    -Will
    My portfolio: lemonadeX.net
    XHTML/CSS/PHP coder for hire

  3. #3
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I checked on my localhost. Even with the html tags in the navbar.php (that are not needed at all), I was able to see the nav bar.

    So the problem has to be somewhere else.

    Is there any other code that you are using? The code we are seeing here, is it all the code?

    Also what about your folder (or file) permissions ?

    This looks more like a loop than anything else.

    I dont think the problem is in the code you have submitted on this thread.

  4. #4
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    arizona
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the help. It didnt work removing the html and body tags.

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    arizona
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    3 hrs wasted and i finally figured out the problem. I put the wrong filename in the php include. I learned that if you try to load the same page in the same file it repeats over and over again.

  6. #6
    SitePoint Evangelist LemoNade's Avatar
    Join Date
    Aug 2005
    Location
    Southampton, UK
    Posts
    500
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    always turns out to be something like that. Don't worry - You aren't the only one :P
    My portfolio: lemonadeX.net
    XHTML/CSS/PHP coder for hire

  7. #7
    SitePoint Guru mwolfe's Avatar
    Join Date
    Mar 2005
    Posts
    912
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol you'd think that would cause a fatal error.. guess the php designers didnt think of that (or didnt have an easy fix)...

  8. #8
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Happens all the time, hate those easy errors.


Bookmarks

Posting Permissions

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