PHP page with several includes only showing one - php

Im very new to php and i have a page with 5 includes located in a directory (called includes) one above where my page is held (called contact
My File Structure is like this
|Index.php (includes workfine)
|Includes
|Contact|index.php
The Index.php in the contact folder only seems to show the form2.php include
<?php include("../../head.php"); ?>
</head>
<body>
<?php include("../../header.php"); ?>
<!-- container -->
<div id="container" class="container_12">
<!-- full width Header-->
<?php include("../../billboard.php"); ?>
<!-- Main Content-->
<div class="grid_8">
<?php include("../form2.php"); ?>
<div class="clear"></div>
</div> <!--main content close-->
<!-- Side Bar-->
<?php include("../../sidebar1.php"); ?>
</div>
</div>
<!--containter close-->
<div id="topspace" class="grid_12"></div>
<?php include("../footer.php"); ?>
</body>
</html>
Errors that appear:
Warning: include(../../head.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 20
Warning: include(../../head.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 20
Warning: include() [function.include]: Failed opening '../../head.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 20
Warning: include(../../header.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 26
Warning: include(../../header.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 26
Warning: include() [function.include]: Failed opening '../../header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 26
Warning: include(../../billboard.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 33
Warning: include(../../billboard.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 33
Warning: include() [function.include]: Failed opening '../../billboard.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 33
Need To Talk About A Mortgage? We Can Contact You..
(form2.php appears here)
Warning: include(../../sidebar1.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 54
Warning: include(../../sidebar1.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 54
Warning: include() [function.include]: Failed opening '../../sidebar1.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 54
Warning: include(../footer.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 67
Warning: include(../footer.php) [function.include]: failed to open stream: No such file or directory in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 67
Warning: include() [function.include]: Failed opening '../footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/superinj/public_html/gholami.co.uk/callback/index.php on line 67
I have access to two servers and have tried uploading to both and both times get the error
What am i missing?
Thanks

If it's one directory above, use ../ instead of ../../
Example:
<?php include("../head.php"); ?>
That is why the form appears and the others don't :)

Looks like you forgot to put the "/Includes/" in your paths
<?php include("../Includes/head.php"); ?>

Related

include_once failed to open stream and Warning: include_once(): Failed opening.for inclusion (include_path='.:/usr/share/pear:/usr/share/php')

I am getting below error . I have already tried with dir , document root, require_once and require.
This error i am getting in Live Server.
Warning: include_once(/storage/ssd1/655/2980655/public_html/Lib/DB//MysqliDb.php): failed to open stream: No such file or directory in /storage/ssd1/655/2980655/public_html/index.php on line 8
Warning: include_once(): Failed opening '/storage/ssd1/655/2980655/public_html/Lib/DB//MysqliDb.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /storage/ssd1/655/2980655/public_html/index.php on line 8
Thank you in Advance.

Cpanel PHP Update, problems with loading

after my hosting provider updated their PHP in cpanel, my site cannot load its php files, someone else made these file and i am trying to detect what the problem might be, here is the output of executed php:
Warning: include(folder_include/config.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 2
Warning: include(folder_include/config.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 2
Warning: include() [function.include]: Failed opening 'folder_include/config.php' for inclusion (include_path='.:/opt/php52/lib/php') in /home/website/public_html/v3/folder_include/classes.php on line 2
Warning: include(folder_include/class.database.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 3
Warning: include(folder_include/class.database.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 3
Warning: include() [function.include]: Failed opening 'folder_include/class.database.php' for inclusion (include_path='.:/opt/php52/lib/php') in /home/website/public_html/v3/folder_include/classes.php on line 3
Warning: include(folder_include/class.misc.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 4
Warning: include(folder_include/class.misc.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 4
Warning: include() [function.include]: Failed opening 'folder_include/class.misc.php' for inclusion (include_path='.:/opt/php52/lib/php') in /home/website/public_html/v3/folder_include/classes.php on line 4
Warning: include(folder_include/class.website.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 5
Warning: include(folder_include/class.website.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 5
Warning: include() [function.include]: Failed opening 'folder_include/class.website.php' for inclusion (include_path='.:/opt/php52/lib/php') in /home/website/public_html/v3/folder_include/classes.php on line 5
Warning: include(folder_include/class.korpa.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 6
Warning: include(folder_include/class.korpa.php) [function.include]: failed to open stream: No such file or directory in /home/website/public_html/v3/folder_include/classes.php on line 6
Warning: include() [function.include]: Failed opening 'folder_include/class.korpa.php' for inclusion (include_path='.:/opt/php52/lib/php') in /home/website/public_html/v3/folder_include/classes.php on line 6
Regards
We need to see these lines to know the problem, but probably the function syntax or name was changed.

unable to connect multiple database in codeigniter

i have two database in a single project. I am trying to connect with the second database for generating one query but it is throwing error on my console. Please help me with this problem
Below Model code i used
//---------connecting with 2nd db--------------------------------------------
public function fetch_all_approved_template_list($limit,$start)
{
$dsn = 'mysql://fitappweb:fitappweb#localhost/fitneapp_webapp';
$dsnDB = $this->load->database($dsn, TRUE);
$dsnDB->limit($limit, $start);
$query = $dsnDB->order_by('routine_id', 'DESC')->join('userdetails', 'userdetails.user_id = template_routines.creater_id')->get_where('template_routines',array('status_code'=>'1'));
$data=array();
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
return false;
}
Error On the browser window
Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in D:\xampp\htdocs\system\core\Exceptions.php on line 182
Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\system\core\Exceptions.php on line 182
error_php.php in a codeigniter application usually contains:
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: <?php echo $severity; ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
</div>
you can place this in your application/errors/error_php.php file. And you will get more details as to what the errors being generated are.
Have you tried setting up the group name in the config file?
After that then you would only have to call it by the group name
$this->load->database('group_name');
Check application/config/databases.php for setting up your database next you can load the database using
$this->load->database('group_name',TRUE);
Read this to manually connect :
http://ellislab.com/codeigniter/user-guide/database/connecting.html
You need to pass an array when loading your DB.
I wouldn't advise connecting manually but your choice.

file not including in wordpress header

i want to include a file in the header file which is in this directory :
wp-content/themes/themename/header.php
the code i used for inclusion is :
include("../../plugins/booking/informationform.php");
while the file which i want to include is in this directory :
wp-content/plugins/booking/informationform.php
so this gives me an error like this :
Warning: include(../../plugins/booking/informationform.php) [function.include]: failed to open stream: No such file or directory
in
/home/zapptv/domains/tvworkshop.com/public_html/wp-content/themes/tvworkshop/header.php
on line 100
Warning: include(../../plugins/booking/informationform.php)
[function.include]: failed to open stream: No such file or directory
in
/home/zapptv/domains/tvworkshop.com/public_html/wp-content/themes/tvworkshop/header.php
on line 100
Warning: include() [function.include]: Failed opening
'../../plugins/booking/informationform.php' for inclusion
(include_path='.:/usr/local/lib/php') in
/home/zapptv/domains/tvworkshop.com/public_html/wp-content/themes/tvworkshop/header.php
on line 100
but when i copy the file in the same directory where the header is and include it with filename only then it s not giving any error and including successfully.

About PHP Dig And Install

I am working on something and it is not working. I am getting this error:
Warning: include(../includes/config.php) [function.include]: failed to open stream: No such file or directory in /home/valerie2/public_html/elinkswap/snorris/install.php on line 24
Warning: include(../includes/config.php) [function.include]: failed to open stream: No such file or directory in /home/valerie2/public_html/elinkswap/snorris/install.php on line 24
Warning: include() [function.include]: Failed opening '../includes/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/valerie2/public_html/elinkswap/snorris/install.php on line 24
Warning: include(../libs/auth.php) [function.include]: failed to open stream: No such file or directory in /home/valerie2/public_html/elinkswap/snorris/install.php on line 25
Warning: include(../libs/auth.php) [function.include]: failed to open stream: No such file or directory in /home/valerie2/public_html/elinkswap/snorris/install.php on line 25
Warning: include() [function.include]: Failed opening '../libs/auth.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/valerie2/public_html/elinkswap/snorris/install.php on line 25
Fatal error: Call to undefined function phpdighttpvars() in /home/valerie2/public_html/elinkswap/snorris/install.php on line 27
Here is the code that it is getting the error:
24. include $relative_script_path.'./includes/config.php';
25. include $relative_script_path.'./libs/auth.php';
26.
27. extract( phpdigHttpVars(
array('step'=>'integer',
Ok on line 24 where the include is there is a dot I put that in there cause sometimes it will help. But it didn't have one there before and I still had the error. I am not understanding why I can not get these to work. Can someone help me understand?
The actual file it is looking for is
$relative_script_path.'./includes/config.php';
One way to debug is to die with that path, then you can check what it's really looking for:
die($relative_script_path.'./includes/config.php');
The page should stop at that point and display the entire file path. You usually then see what the error could be.

Categories