SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Places
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Are too many PHP includes a bad thing?

    I have a site that is heavily smothered in PHP includes, mostly because I need loads of things to appear in more than one place and I don't want to have to edit every single page when I change something. Also, my site has several versions for different browsers.

    Most of my pages initially consist of three PHP includes, one for the top, one for content, and one for the bottom. But inside the top and content, most especially the content, it is RIFE with PHP includes. There are sometimes as many as twenty or more in the content PHP's.

    However, right now, in Mozilla (the browser I am currently tweaking the site for), the pages take forever to load and sometimes come up blank or with the includes replaced by error messages.

    Are too many PHP includes a bad thing? Do they clog up the site and make it unusable?

    If so, is there any solution or other coding I could use so I don't have to update every single page when I change something?

    The site: http://www.the-vent.equiangular.net
    Mozilla index: http://www.the-vent.equiangular.net/...a/mozindex.php
    Sample page: http://www.the-vent.equiangular.net/...es/kracken.php

    Someone please help soon and thanks,

    equang

    PS, I can post my initial files with the includes in them (actual include coding doesn't show up when you just view the source) if anyone wants to take a look.

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by equang
    However, right now, in Mozilla (the browser I am currently tweaking the site for), the pages take forever to load and sometimes come up blank or with the includes replaced by error messages.

    Are too many PHP includes a bad thing? Do they clog up the site and make it unusable?
    1) That sounds more like a network or host problem than a PHP one

    2) It all depends on exactly what these includes are doing. Can you post some code please?

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Places
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's some of the coding:

    This is the file for this page: http://www.the-vent-equiangular.net/mozilla/authorpages/kracken.php

    <? include("http://www.the-vent.equiangular.net/mozilla/mozdiv.php") ?>

    <? include("http://www.the-vent.equiangular.net/authorpages/kracken.php") ?>

    <? include("http://www.the-vent.equiangular.net/mozilla/mozlow.php") ?>

    This is the file for the first PHP include: http://www.the-vent.equiangular.net/mozilla/mozdiv.php

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>The Ventilation Shaft</title>
    <meta name="language" content="en-US">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <LINK href="http://www.the-vent.equiangular.net/vent.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <center>
    <table border="0px" width="991px" cellspacing="0px" cellpadding="0px"></center>
    <tr>
    <td rowspan=2 bgcolor="#3D5369" valign="top" width="150px">
    <table cellpadding="3px"><tr><td valign="top">
    <? include("http://www.the-vent.equiangular.net/1.php") ?>
    </td></tr></table>
    </td>
    <td bgcolor="#3D5369" valign="top" height="436px">
    <img src="http://www.the-vent.equiangular.net/images/vs1.jpg" usemap="#mymap" width="576px" height="436px" border="0px" alt="">
    <map name="mymap">
    <area shape="rect" coords="170,0,323,143" href="http://www.the-vent.equiangular.net/mozilla/mozindex.php" alt="Home">
    <area shape="rect" coords="206,158,260,184" href="http://www.the-vent.equiangular.net/mozilla/links.php" alt="Links">
    <area shape="rect" coords="232,186,264,213" href="http://www.the-vent.equiangular.net/mozilla/guide.php" alt="Guide">
    <area shape="rect" coords="202,214,302,252" href="http://www.the-vent.equiangular.net/guestbook/guestbook.cgi?action=add" alt="Guestbook">
    <area shape="rect" coords="188,253,314,299" href="http://www.the-vent.equiangular.net/mozilla/submissions.php" alt="Submissions">
    <area shape="rect" coords="180,316,328,390" href="http://www.the-vent.equiangular.net/mozilla/fanfiction.php" alt="Fanfiction">
    <area shape="rect" coords="326,126,406,220" href="http://www.the-vent.equiangular.net/mozilla/sistersites.php" alt="Sister Sites">
    <area shape="rect" coords="504,88,570,135" href="http://www.the-vent.equiangular.net/mozilla/contact.php" alt="Contact">
    </map>
    </td>
    <td rowspan=2 bgcolor="#3D5369" valign="top" width="265px">
    <table cellpadding="3px"><tr><td valign="top">
    <? include("http://www.the-vent.equiangular.net/2.php") ?>
    </td></tr></table>
    </td>
    </tr>
    <tr>
    <td bgcolor="#5A7E8F" valign="top"><table cellpadding="3px"><tr><td valign="top">

    And then the two PHP includes in there are these:

    1: http://www.the-vent.equiangular.net/1.php


    <br><center><a href="http://www.dreamhost.com/donate.cgi?id=1511"><img src="http://www.the-vent.equiangular.net/images/donations.jpg" border="0" alt="Help pay my DreamHost bill to keep The Ventilation Shaft up and running!"></a></center>
    <div align="left">
    <p><font size="1">The Ventilation Shaft is an archive dedicated to Gundam Wing fanfiction. It was originaly intended to house only 1x2x5, 1x2x1, 5x2x5, and 1x5x1, but it has now expanded to include others (and still more may be added in the future).</font></p>
    <p><font size="1">This site was tailor-made for Internet Explorer with a 1024x768 resolution, so if you <i>don't</i> have that, then it's going to be awfully skewed, but don't blame me if it looks sloppy, that's just your web browser.</font></p>
    <p><font size="1">Warnings- The Ventilation Shaft contains fanfiction of the homosexual nature. Also, much of the fanfiction here is R-rated or NC-17, so I hereby warn our younger readers.</font></p>
    <p><font size="1">In order to navigate this site, you'll find links on the center image. The Vent is extensively organized. You can find fanfiction by pairing, author, alphabetically, and now by quality.</font></p>
    <p><font size="1">Also, *nudges* feel free to sign our guestbook. Tell me what you think about the site.</font></p>
    <p><font size="1">Archiving is by invitation and submission.</font></p>
    <p><font size="1">Disclaimer- I, and the authors represented here, do not own Gundam Wing, its characters, or anything to do with it (except for a few action models). Neither do we own any other copyrighted material (ie. song lyrics, brand names) found within the fiction. Also, all work present here belongs to its respective author, who has graciously allowed me to present it on my page.</font></p>
    <p><font size="1">Thank you and good day.</font></p>
    <p><font size="1">The Ventilation Shaft is copyright K D 2003.</font></p>
    <center><a href="http://www.dreamhost.com/rewards.cgi?ketty-death"><img src="http://www.the-vent.equiangular.net/images/dreamhost2.gif" border="0" alt=""></a></center>
    <p><font size="1">Yeah, <a href="http://www.dreamhost.com/rewards.cgi?ketty-death">Dreamhost</a> is <i>that</i> good.</font></p>

    2: http://www.the-vent.equiangular.net/2.php

    <div align="left">
    <p><font size="4">Notes/font></p>
    <p><font size="1">Join the Updates mL! Receive news and updates about the site!<br>
    <a href="http://www.groups.yahoo.com/group/the-vent_updates/join">The Ventilation Shaft Updates Mailing List</a></font></p>
    <p><font size="1">Join the Submissions mL! Here you can post and read fanfiction and maybe even be scouted for archiving at the Vent!<br>
    <a href="http://www.groups.yahoo.com/group/the-vent_submissions/join">The Ventilation Shaft Submissions Mailing List</a></font></p>
    <p><font size="1"><b>Message to those who have fanfiction archives of their own/b> if you have permission from the authors to archive fics also found here, feel free to steal my HTML. I completely understand what a pain in the <i>***</i> archiving is. Just don't steal my site design or fic layout (aka, how I actually set up the fics' headers and footers and such).</font></p>
    <p><font size="4">News/font></p>
    <p><font size="2"><b>July 2, 2004</b></font></p>
    <p><font size="1">Okay, <i>now</i> I'm done. I hope. Besides that new round of authors to pursue. The favorite author poll is online and the main site guestbook (which I overlooked) has been configured. I'd been meaning to change it to the active-scripts guestbook I downloaded instead of mooching off of Dreambook.com anymore and I finally did it. Big thanks to Dreamhost (link in bottom left corner) for hosting my site so beautifully. <3 <3 <3.</font></p>
    <p><font size="2"><b>June 29, 2004</b></font></p>
    <p><font size="1">Oh cheese on a cracker, I think I'm done. Fanfiction uploaded, check. Review system finished, check. Author pages created, check. Fic php's created, check. Fic pages uploaded, check. Voting system online, check. Mailing lists created, check. Side pages created, check.</font></p>
    <p><font size="1">What the hell am I gonna do with myself now?!</font></p>
    <p><font size="2"><b>June 23, 2004</b></font></p>
    <p><font size="1">All archiving is d-o-n-e DONE!!!! *cheers* I never thought I'd see this day *wipes tear from eye*. At any rate, still a long list of things to accomplish to go.</font></p>
    <p><font size="1">Alright! I figured out the review system and that is up and working! I just have to configure every single book individually for each and every author *weeps*. It's like... 20 minutes a book! *dies* Welp, at least I'm a genius.</font></p>
    <p><font size="2"><b>June 10, 2004</b></font></p>
    <p><font size="1">Okay, I have been archiving like <i>hell</i>, and a miracle must have fallen at my feet because I have but two authors left >D <i>!!!</i> But then again, seeing as those authors are ****ing Kracken and Maldoror, I'm thinking I landed in the Library of Doom instead!</font></p>
    <p><font size="1">Anyways, it's coming along splendidly and I should have it all done in a couple of days.</font></p>
    <p><font size="1">And then on to author pages! Whoopee!</font></p>

    The bottom PHP include of the main page looks like this: http://www.the-vent.equiangular.net/mozilla/mozlow.php

    <? include("http://www.the-vent.equiangular.net/ff/note.php") ?><br>
    </td></tr></table>
    </td>
    </tr>
    </table>
    </body>
    </html>

    The PHP include in THERE looks like this: http://www.the-vent.equiangular.net/ff/note.php

    <p><center><font size="1">Dear Authors, if you find that anything is missing from your author page, such as a correct email address or website(s), please contact me, K D, <a href="mailto:the-vent@equiangular.net">here</a>. The review system is courtesy of <a href="http://www.active-scripts.net">Active-Scripts</a>.</font></center>

    Now the actual content PHP include, the one in the middle of the main page file, looks like this: http://www.the-vent.equiangular.net/authorpages/kracken.php

    <center><font size="6"><p>Kracken</p></center>
    <font size="3">
    <p><a href="mailto:kracken@bonpublishing.com">Email Kracken</a><br>
    <a href="http://www.kracken.bonpublishing.com/" target="_blank">Kracken</a><br>
    <a href="http://www.bonpublishing.com/" target="_blank">Bonpublishing</a><br>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/reviews/reviews.cgi">Kracken's Reviews</a><br>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/reviews/reviews.cgi?action=add">Add a Review</a>
    </p>

    <? include("http://www.the-vent.equiangular.net/ff/Kracken/atr.php") ?>
    <br>
    <? include("http://www.the-vent.equiangular.net/ff/Kracken/bbl.php") ?>
    <br>
    <? include("http://www.the-vent.equiangular.net/ff/Kracken/bp.php") ?>
    <br>
    <? include("http://www.the-vent.equiangular.net/ff/Kracken/cp.php") ?>
    <br>
    <? include("http://www.the-vent.equiangular.net/ff/Kracken/lh.php") ?>
    <br>
    <? include("http://www.the-vent.equiangular.net/ff/Kracken/ls.php") ?>
    <br>
    <? include("http://www.the-vent.equiangular.net/ff/Kracken/pas.php") ?>
    <br>
    <? include("http://www.the-vent.equiangular.net/ff/Kracken/sb.php") ?>

    <center><p><font size="4"><a href="http://www.the-vent.equiangular.net/mozilla/authorpages/kracken2.php">Next</a></p></center>

    In THERE, there are fic PHP's (that's what I've dubbed them, sample: <? include("http://www.the-vent.equiangular.net/ff/Kracken/sb.php") ?>), and one of those looks like this: http://www.the-vent.equiangular.net/ff/Kracken/sb.php

    <? include("http://www.the-vent.equiangular.net/fic/top.php") ?>Soldier Boys Series
    <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>Author:
    <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>Kracken
    <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>Rating:
    <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>NC-17
    <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>Pairings:
    <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>1x2
    <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>Warnings:
    <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>Language, angst, yaoi, lemon, violence, attempted NCS
    <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>Summary:
    <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>Is there room for love during wartime?
    <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>K D's Note:
    <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>I don't remember if I read this one... I probably did...
    <? include("http://www.the-vent.equiangular.net/fic/lower.php") ?>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys1.html" target="_blank">[1]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys2.html" target="_blank">[2]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys3.html" target="_blank">[3]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys4.html" target="_blank">[4]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys5.html" target="_blank">[5]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys6.html" target="_blank">[6]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys7.html" target="_blank">[7]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys8.html" target="_blank">[8]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys9.html" target="_blank">[9]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys10.html" target="_blank">[10]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys11.html" target="_blank">[11]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys12.html" target="_blank">[12]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys13.html" target="_blank">[13]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys14.html" target="_blank">[14]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys15.html" target="_blank">[15]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys16.html" target="_blank">[16]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys17.html" target="_blank">[17]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys18.html" target="_blank">[18]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys19.html" target="_blank">[19]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys20.html" target="_blank">[20]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys21.html" target="_blank">[21]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys22.html" target="_blank">[22]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys23.html" target="_blank">[23]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys24.html" target="_blank">[24]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys25.html" target="_blank">[25]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys26.html" target="_blank">[26]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys27.html" target="_blank">[27]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys28.html" target="_blank">[28]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys29.html" target="_blank">[29]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys30.html" target="_blank">[30]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys31.html" target="_blank">[31]</a>
    <a href="http://www.the-vent.equiangular.net/ff/Kracken/sb/boys32.html" target="_blank">[32]</a>
    <? include("http://www.the-vent.equiangular.net/fic/bottom.php") ?>

    And the PHP includes in there are these:
    <? include("http://www.the-vent.equiangular.net/fic/top.php") ?>
    <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>
    <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>
    <? include("http://www.the-vent.equiangular.net/fic/lower.php") ?>
    <? include("http://www.the-vent.equiangular.net/fic/bottom.php") ?>

    1. <? include("http://www.the-vent.equiangular.net/fic/top.php") ?>


    <center><table width="500px" cellspacing="0px" border="2px" brdrcolor="#3D5369"><tr><td colspan="2" bgcolor="#3D5369"><font size="3">

    2. <? include("http://www.the-vent.equiangular.net/fic/upper.php") ?>

    </td></tr><tr><td width="100px" valign="top"><font size="2">

    3. <? include("http://www.the-vent.equiangular.net/fic/middle.php") ?>

    </td><td width="400px"><font size="2">

    4. <? include("http://www.the-vent.equiangular.net/fic/lower.php") ?>

    </td></tr><tr><td colspan="2" bgcolor="#3D5369"><font size="2">

    5. <? include("http://www.the-vent.equiangular.net/fic/bottom.php") ?>

    </td></tr></table></center>

    And that's everything that goes into a single page. Ta da! Have fun. There's actually a second page but I didn't think you needed to see it because it's pretty much exactly the same minus a few links. But really, is that too many PHP includes? Dreamhost is my webhost so I'm not so sure there's a problem there because they are so wonderful. I probably messed up something in the HTML again, I've been known to do it before. It'd be a pain if I did though *grimace*.

    But anyways, scan over it and tell me what you think. Thanks!

    equang

  4. #4
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont think the inlcludes are your problem...they seem to be fine.

    -asT

  5. #5
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by equang
    I probably messed up something in the HTML again, I've been known to do it before. It'd be a pain if I did though *grimace*.
    31 errors

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Places
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *dies*

    Oh geez, this again.

    Well, thanks guys, I'll validate it and if I have any more problems, I'll come back.


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
  •