PDA

View Full Version : PHP include



-paul.
18-01-2011, 04:30 PM
Im trying to include a DJ Says to my site. But i keep getting this error


arning: include(../config.php) [function.include]: failed to open stream: No such file or directory in /home/********/public_html/******/panel/*****/djsays.php on line 20

Warning: include(../config.php) [function.include]: failed to open stream: No such file or directory in /home/********/public_html/******/panel/*****/djsays.php on line 20

Warning: include() [function.include]: Failed opening '../config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/********/public_html/******/panel/*****/djsays.php on line 20

Warning: mysql_query() [function.mysql-query]: Access denied for user 'highhero'@'localhost' (using password: NO) in /home/********/public_html/******/panel/*****/djsays.php on line 21

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/********/public_html/******/panel/*****/djsays.php on line 21

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/********/public_html/******/panel/*****/djsays.php on line 22

The code im using is simply

<?php
include("../panel/public/djsays.php");
?>

hamheyelliot
18-01-2011, 04:59 PM
Does the DJ Says script work on it's own? Some of those errors being thrown up look related to the djsays.php file rather than the include or anything.

-paul.
18-01-2011, 05:14 PM
Its apart of a panel which was made by a friend. There's a public folder in which is meant to be accessable

hamheyelliot
18-01-2011, 05:22 PM
Mind sharing djsays.php or at least lines 20 and 21? I think that's the source of the problem here.

LMS16
18-01-2011, 06:26 PM
Elliot, you dont know what your talking about...
Its obviously can not find the file on the given path.

With PHP include, you need to give the exact path to the file. So for example, if you were including "config.php" in an "includes/" folder and a file you were including in the "includes/" folder was also in that folder, & u were included the config.php file in a parent directory, you would have to link to the file like: "/includes/otherfile.php"

Lew.

Want to hide these adverts? Register an account for free!