SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple PHP include breaks suddenly

    We use a PHP include to retrieve news that we generate using CuteNews. Sometime this weekend, this suddenly broke. The browser recieves all of the page information up to the include. But the include and everything after it in the code isn't shown. This only affects the two pages with an include, the homepage and the archive page.

    http://www.metalpodcast.net

    here's the code from index.php

    Code:
    </p>
    			<a href="http://www.ragnarokradio.blogspot.com"><img src="./assets/ragnarokbanner.png" alt="" border="0" /></a>
    			<a href="http://www.nonemoreblackrecords.com"><img src="./assets/nmbbanner.png" alt="" border="0" /></a>
    			
    			</td>
    			<!--main column-->
    		<td width="59%" class="contentbg" style="a {color: #006699; text-decoration: underline;}" valign="top">
    		<p>Welcome to the official Metalscape site. Metalscape is a weekly podcast dedicated to metal music of all genres. Join Zach and Ron as they take you on a wild ride through crazy news stories, metal news, norse mythology, and the best metal music on this planet.</p>
      <?PHP
    $number=10;
    $template="ms";
    $only_active=TRUE;
    include("/homepages/16/d178614398/htdocs/cutenews/show_news.php");
    ?>
    		</td>
    <!-- right column -->
    		<td width="186px" valign="top" align="center">
    		<a href="javascript:void(0)" onclick="window.open('http://www.podtrac.com/PodtracPlayer/podtracplayer.aspx?podcast=http://www.metalscapeonline.net/rss.xml', 'linkname', 'height=235, width=450, scrollbars=no')">
    <img src="./assets/podtrac.png" alt="Podtrac Player" border=0 /></a>
    		<p>
    and here's the code from archive.php

    Code:
    <p class="bold">
    			We Support
    			</p>
    			<a href="http://www.ragnarokradio.blogspot.com"><img src="./assets/ragnarokbanner.png" alt="" border="0" /></a>
    			<a href="http://www.nonemoreblackrecords.com"><img src="./assets/nmbbanner.png" alt="" border="0" /></a>
    			</td>
    			<!--main column-->
    			
    		<td width="59%" class="contentbg" style="a {color: #006699; text-decoration: underline;}" valign="top">
    			
    					<?PHP
    $template="Headlines";
    $category=1;
    include("/homepages/16/d178614398/htdocs/cutenews/show_news.php");
    ?>
    <p>Looking for episodes 1 - 19? <a href="oldarchive.html">CLICK HERE</a></p>
    					
    
    		</td>
    <!-- right column -->
    		<td width="186px" valign="top" align="center">
    		<a href="javascript:void(0)" onclick="window.open('http://www.podtrac.com/PodtracPlayer/podtracplayer.aspx?podcast=http://www.metalscapeonline.net/rss.xml', 'linkname', 'height=235, width=450, scrollbars=no')">
    <img src="./assets/podtrac.png" alt="Podtrac Player" border=0 /></a>

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,140
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    path

    Is the path real or virtual?

  3. #3
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't even know what that means.

  4. #4
    SitePoint Evangelist priti's Avatar
    Join Date
    Aug 2006
    Location
    India
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zachms View Post
    I don't even know what that means.
    Can you check weather
    ->your file exists or not at the location specified.
    "/homepages/16/d178614398/htdocs/cutenews/show_news.php"

    what error you are getting exactly???

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,140
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    path

    Do you really have a folder named "homepages" with a folder named "16" in it, which has a folder named "d178614398" in it, which has a folder named "htdocs" in it which has a folder named "cutenews" in it, which has the file "show_news.php" in it?
    If so, are the folder/file permissions OK?
    If not, did any htaccess rules change?

  6. #6
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,332
    Mentioned
    192 Post(s)
    Tagged
    4 Thread(s)
    If the page stopped working correctly, suddenly over the weekend, I would recommend you touch base with your host.
    Some configuration may have changed.
    Additionally, they need to be aware that whatever change they made affected paying customers.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  7. #7
    SitePoint Evangelist bradical1379's Avatar
    Join Date
    Feb 2007
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are headers being sent by the included file?

  8. #8
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no path "/homepages/16/d178614398/htdocs/cutenews/show_news.php", the "cutenews" folder is in the same directory as the index.php which I thought was the root. I tried removing the "/homepages/16/d178614398/htdocs/cutenews" but it didn't make a difference, so I put it back.

    I think the permissions are right. The public is set to read the file.

  9. #9
    SitePoint Evangelist bradical1379's Avatar
    Join Date
    Feb 2007
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try:

    Code PHP:
    include('/cutenews/shows_news.php');

  10. #10
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    982
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you turned on error reporting?
    PHP Code:
    error_reporting(E_ALL); 
    MySQL v5.1.58
    PHP v5.3.6

  11. #11
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bradical1379 View Post
    try:

    Code PHP:
    include('/cutenews/shows_news.php');
    This fixes the content in the right column. But the show_news.php file still isn't showing.

  12. #12
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    what about removing the first slash?
    PHP Code:
    include('cutenews/shows_news.php'); 
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  13. #13
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arkinstall View Post
    what about removing the first slash?
    PHP Code:
    include('cutenews/shows_news.php'); 
    Didn't do anything.

  14. #14
    SitePoint Evangelist bradical1379's Avatar
    Join Date
    Feb 2007
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the error that is appearing?

  15. #15
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not giving an error. The content just isn't showing up. I put that error_reporting thing in too.

  16. #16
    SitePoint Evangelist bradical1379's Avatar
    Join Date
    Feb 2007
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zachms View Post
    It's not giving an error. The content just isn't showing up. I put that error_reporting thing in too.
    Then it's something in your show_news.php file not working. The includes has nothing to do with it.

  17. #17
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well now my entire cutenews directory seems to be deleted. Wonderful.


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
  •