SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    Turnersvill, NJ
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I have a problem. I included this statement:

    <!--#include virtual="/includes/something.txt"#-->

    (I also tried:
    <!--#include virtual="/includes/something.htm"#-->


    in the middle of a web page. When I check the page source online, the INCLUDE file is there, but NO other source code (the normal web site code) is not. Therefore the page is not complete and bombs out.

    I guess my question is:
    Can you have a SSI call in the MIDDLE of the page? I would think you can.

    Here is the code for my include file:
    ******
    <table width="100%" border="0" cellspacing="8" cellpadding="3">
    <tr>
    <td bgcolor="#003366" valign="middle">
    <div align="left"><font size="2" face="Arial, Helvetica, sans-serif" class="s2"><a href="/contest">Online Contest</a></font></div>
    </td>
    <td valign="middle">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="2"></td>
    </tr>
    </table>
    ******
    In case you need MORE reading material, here is where I call the include (Keep in mind that this is in the middle of the source code. I did not want to print the ENTIRE web page. It is pretty big!!!:

    <table BORDER=0 topmargin="0" leftmargin="0" topborder="0" leftborder="0" CELLPADDING=0 CELLSPACING=0>
    <tr valign="top">
    <td>
    <div align="left"><font size="1"><a href="../tellafriend" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','../graphic/tellon.gif',1)"><img name="Image21" border="0" src="../graphic/tellafriend.gif" width="127" height="26" alt="tell a friend"></a></font></div>
    </td>
    </tr>
    <tr>
    <td>
    <div align="left"><font size="1"><a href="/postcard" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image22','','../graphic/poston.gif',1)"><img name="Image22" border="0" src="../graphic/postcard.gif" width="127" height="40" alt="send postcard"></a></font></div>
    </td>
    </tr>
    <tr>
    <td>
    <div align="left"><!--#include virtual="/includes/something.txt"#--></div>
    </td>
    </tr>
    <tr>
    <td>
    <div align="left"></div>
    </td>
    </tr>
    </table>
    *************

    After it inserts the INLCUDE FILE, the page stops loading. Thank you very much for your help!
    singer/songwriter...that's why I ask all the questions!
    www.keithlubrant.com

  2. #2
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you can place the SSI anywhere in a page. Did you add an .shtml extension to the page the SSI is in?
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Herndon, VA
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If .shtml does not work, make sure that it is enabled on your server. If that does not work, bust out one of these bad boys:
    <? include("file.html") ?>
    It's php and if it's enabled on your server it will do the same as .shtml.
    --
    Coolrandomfree- Download stupid movies and do stupid stuff!
    Coolrandomfree Message Boards

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    Turnersvill, NJ
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your post!

    I already have a CGI-Counter on my page...I cannot go to PHP. The includes work because my counter works. Is there a different INCLUDE syntax?

    (p.s. - The extension is .shtml)

    Thanks
    singer/songwriter...that's why I ask all the questions!
    www.keithlubrant.com

  5. #5
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it is the '#' at the end of the ssi construct. Take that out and it should work. Good luck
    --Bil
    Lake Superior Smokin' Brews Make It Different: Brew Your Own!
    L'Etoile du Nord Web Development Providing Real Direction in a Virtual World
    MSN IM: smokinbrews-AT-hotmail-DOT-com
    Brewin', Vintin' & Smokin' Forums Moderator

  6. #6
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe Sahti is correct. I've never seen two '#'s in an include statement. Also, did you know that just typing this line of code:
    Code:
    <!--#include file="include.inc"-->
    will inlcude a virtual path as well. I had some trouble using the 'virtual' statment, but when doing it regularly it worked fine.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    Turnersvill, NJ
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for everybody's responses!
    I am not at my computer now, but when I am, I will give it another whirl!

    Thanks a bunch for your help!
    singer/songwriter...that's why I ask all the questions!
    www.keithlubrant.com

  8. #8
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you should remove the last # and instead of using virtual="filename.txt" try using file="filename.txt" instead and have the text file in the same folder as the .shtml file and see if it works.

    Don't forget to give the webpage a .shtml extention instead so the server knows it's a server side include file.

    rgds,

  9. #9
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Keith,

    I believe I said that.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  10. #10
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi klubrant,

    Check out this tutorial at UseForSite.com.

    Also check out this article by Matt Mickiewicz of "SitePoint".

    I think these two reference will help you out.

    WP
    Webbing Along!!!


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
  •