Php include not working

I have never had this happen before. I am trying to use a <?php include for my right sidebar but it is saying “failed to open stream” I know the file is uploaded but it is not showing up. I have searched everywhere for the issue and all I could find was that the doctype could be an issue, but I tried them all and nothing would work.

It is also doing it to my include mysql_connect on the top of the page.

Here is what I have for my index.php ( I stripped out all the css files so it can be read easy )

<?php 
include_once('mysql_connect.php');
$Amt = 4;//Amount per page
$Cat = $_GET['Cat'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    
    <title>Website Title</title>

    <style type="text/css">
    #rt-logo {background: url(images/logo.png) 50% 0 no-repeat !important;}
    #rt-logo {width: 282px;height: 58px;}
    h1, h2 { font-family: 'Droid Sans', 'Helvetica', arial, serif; }
    </style>
  

</head>
<body  class="logo-type-custom header-type-preset1 main-pattern-dust footer-type-preset1 font-family-droid-sans font-size-is-default menu-type-dropdownmenu layout-mode-responsive col12">
<div id="rt-page-surround">
    <div id="rt-drawer">
        <div class="rt-container">
            <div class="clear"></div>
        </div>
    </div>
    
<!--STARTS HEADER-->    
<header id="rt-top-surround" class="rt-dark" style="height:420px">
<div class="rt-topbar"></div>
<!--Starts rt-header-->
<div id="rt-header">
    <div class="rt-container">
        <div class="rt-grid-4 rt-alpha">
            <div class="rt-block logo-block">
            <a href="index.php" id="rt-logo"></a>
            </div>
        </div>
        <div class="rt-grid-8 rt-omega">
        <!--Starts rt-block menu-block-->
            <div class="rt-block menu-block">
                <div class="gf-menu-device-container"></div>
                    <ul class="gf-menu l1 " >
                    <li class="item101 active last" ><a class="item" href="index.php"  >Home </a></li>
                                    <div class="clear"></div>
            </div>
        <!--ends rt-block menu-block -->

        </div>
        <!--ends Ends rtomega-->
    <div class="clear"></div>
    </div><!-- ends rt-container-->
</div>
<!--Ends rt-header-->
</header>

<!--starts container-->
<div class="rt-container"  style="background-color:#0F0">


<!--starts Left Side-->
<div class="rt-grid-9 rt-alpha rt-omega" style="margin-top:20px">
    <div class="midtop"></div>
    	<div class="midTitle"></div>
    <div class="midbtm"></div>

    <div class="midtop"></div>
    	<div class="midContent"></div>
    <div class="midbtm"></div>
</div>
<!--ends Left Side-->

<!--starts Right Side-->
<div class="rt-grid-3" style="float:right">
	<?php include ('right.php');?>
</div>
<!--ends Right Side-->

</div>
<!--ends container-->




</body>
</html>

Disregard, The page I was looking at was the index.html and not the .php . Rookie mistake. Sometimes it is the obvious that gets you.

1 Like

Too true…too true.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.