SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Aug 2001
    Location
    Los Angeles, CA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What in the world is wrong with this???

    Hi all,

    I'm writing a script, using PHP OO code as a structure to make a site that I built easier to update. My PHP page should look like this:

    http://www.html4me.com/tester

    I have an include1.txt file with the OO code and basic structure for the web page, and the file index.php just has the main content of the page.

    You can see it here:

    http://www.html4me.com/tester/be/index.php

    For some reason I am always getting an error on the last line of my code, line 206. (This is in include1.txt, the file I require in index.php).

    You can see the include1.txt file here:

    http://www.html4me.com/tester/be/include1.txt

    (right click, save target as, etc.)

    The index.php file here:

    http://www.html4me.com/tester/be/index.txt

    Thanks in advance,

    GregC

  2. #2
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function DisplayFooter()

    {

    ?>
    <BR><BR>
    <table cellpadding=1 cellspacing=1 border=0>
    <tr>
    <TD>
    <font face=Arial size=2>&copy; 1997 - 2002 Dynamic Doingness, Inc. All rights reserved.</font>
    </TD>
    </tr>
    </table>

    }

    }
    shouldn't the last } } be in <? ?>

  3. #3
    SitePoint Guru Husain's Avatar
    Join Date
    Sep 2001
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lines 202 - 207 should be in PHP delimeters. You forgot to put them into that. You started a function on line 189 and forgot to close it (the function should end at line 207).

    Hope this is clear enough.

    EDIT: Did not notice your post johnn. Sorry.
    Last edited by Husain; Mar 1, 2002 at 01:02.

  4. #4
    SitePoint Addict
    Join Date
    Aug 2001
    Location
    Los Angeles, CA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It still brings up errors even after I put the ?>'s - anything else it could be?

    Thanks-

    GregC

  5. #5
    SitePoint Guru Husain's Avatar
    Join Date
    Sep 2001
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    }
    <?php
    
    function DisplayFooter()
    
    {
    should be:
    Code:
    <?php
    }
    
    function DisplayFooter()
    {

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this function isnt fully enclosed in php tags...

    PHP Code:
    <?php

    function DisplayJS()

    {

        
    ?>
        <script language='javascript'>
        ...    </script>

    }

  7. #7
    SitePoint Addict
    Join Date
    Aug 2001
    Location
    Los Angeles, CA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did all that you guys said - and amazingly, it still doesn't work!

    http://www.html4me.com/tester/be/index.php

    Any other suggestions?

    Thanks-

  8. #8
    SitePoint Guru Husain's Avatar
    Join Date
    Sep 2001
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <?php
    }
    
    function DisplayFooter()
    
    {
    ?>
    	
    <BR><BR>
    <table cellpadding=1 cellspacing=1 border=0>
    <tr>
    <TD>
    <font face=Arial size=2>&copy; 1997 - 2002 Dynamic Doingness, Inc. All rights reserved.</font>
    </TD>
    </tr>
    </table>
    
    }
    Can you see what is wrong on the last line? Shouldn't the } be enclosed in PHP delimeters?
    Code:
    <?php
    }
    
    function DisplayFooter()
    
    {
    ?>
    	
    <BR><BR>
    <table cellpadding=1 cellspacing=1 border=0>
    <tr>
    <TD>
    <font face=Arial size=2>&copy; 1997 - 2002 Dynamic Doingness, Inc. All rights reserved.</font>
    </TD>
    </tr>
    </table>
    
    <?php
    }
    ?>

  9. #9
    SitePoint Guru Husain's Avatar
    Join Date
    Sep 2001
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <?php
    
    }
    
    
    
    function DisplayJS()
    
    {
    
    	?>
    	<script language='javascript'>
    	function mOvr(src) { if (!src.contains(event.fromElement)){src.bgColor = '#FFFFFF';src.children(0).style.color='#dadada';}}
    	function mOut(src) { if (!src.contains(event.toElement))  {src.bgColor = '#FFCC33';window.status=' ';src.children(0).style.color='#c6c6c6';}}
    	</script>
    
    }
    
    <?php
    
    function DisplayHeader()
    
    {
    ?>
    See any errors here (line 120)? It should be:
    Code:
    <?php
    
    }
    
    
    
    function DisplayJS()
    
    {
    
    	?>
    	<script language='javascript'>
    	function mOvr(src) { if (!src.contains(event.fromElement)){src.bgColor = '#FFFFFF';src.children(0).style.color='#dadada';}}
    	function mOut(src) { if (!src.contains(event.toElement))  {src.bgColor = '#FFCC33';window.status=' ';src.children(0).style.color='#c6c6c6';}}
    	</script>
    
    <?php
    
    }
    
    function DisplayHeader()
    
    {
    ?>

  10. #10
    SitePoint Addict
    Join Date
    Aug 2001
    Location
    Los Angeles, CA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! It works now:

    http://www.html4me.com/tester/be/index.php

    Just did what you said, added a tweak or two, and it works! Whoopee!

    Thanks again-

    GregC


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
  •