Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5

Thread: PHP include

  1. #1
    Join Date
    Apr 2005
    Location
    Milton Keynes
    Posts
    725
    Tokens
    2,589
    Habbo
    -Paul.

    Latest Awards:

    Default PHP include

    Im trying to include a DJ Says to my site. But i keep getting this error

    Code:
    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
    Code:
    <?php
    include("../panel/public/djsays.php");
    ?>
    Last edited by -paul.; 18-01-2011 at 04:38 PM.
    DJ Porky

    2006-2015
    Habtips - Habbolot - Habbox - Habbed - HHGS

  2. #2
    Join Date
    Dec 2007
    Location
    Manchester
    Posts
    2,236
    Tokens
    118
    Habbo
    hamheyelliot

    Latest Awards:

    Default

    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.

  3. #3
    Join Date
    Apr 2005
    Location
    Milton Keynes
    Posts
    725
    Tokens
    2,589
    Habbo
    -Paul.

    Latest Awards:

    Default

    Its apart of a panel which was made by a friend. There's a public folder in which is meant to be accessable
    DJ Porky

    2006-2015
    Habtips - Habbolot - Habbox - Habbed - HHGS

  4. #4
    Join Date
    Dec 2007
    Location
    Manchester
    Posts
    2,236
    Tokens
    118
    Habbo
    hamheyelliot

    Latest Awards:

    Default

    Mind sharing djsays.php or at least lines 20 and 21? I think that's the source of the problem here.

  5. #5
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    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.
    Last edited by LMS16; 18-01-2011 at 06:31 PM.
    Im not here to be loved, I love to be hated :-}


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •