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!


Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30
  1. #21
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    @dent: Where should I declare them... lmao
    @protege: i know that...

    Up to line 66:
    PHP Code:
    <?php
    #######################
    # Configuration #######
    #######################
    // Database Connection
    removed
    // Gets an array with the active user's information
    $query mysql_query("SELECT * FROM users WHERE username = '{$_SESSION['username']}'",$conn);
    $userinfo mysql_fetch_array($query);
    // Bans
    if($userinfo['banned'] == 'yes') {
     include(
    'banned.php');
     die();
    }
    // Messages
    $msgquery mysql_query("SELECT * FROM `pms` WHERE `to` = '{$_SESSION['username']}' ORDER BY `id` DESC",$conn); 
    $msgnum mysql_num_rows($msgquery);
    // Version No.
    $version 'r1 BETA';
    // Admin/System Email
    $adminemail '';
    // Errors
    $err_login 'You must be logged in to view this page. Please <a href="login.php">login</a> or <a href="register.php">register</a>.';
    $err_auth 'Only authorized staff can view this page!';
    $err_notfound 'The page you were looking for could not be found. Click <a href="index.php">here</a> to go back to the main page.';
    // IP
    $ip $_SERVER['REMOTE_ADDR'];
    // Date
    $day date('l'); 
    $month date('F');
    $daynum date('j');
    $year date('Y');
    $date $day.', '.$month.' '.$daynum.', '.$year;
    #######################
    # System Functions ####
    #######################
    // Cleaning Input
    function clean($str) {
     if(!
    get_magic_quotes_gpc()) {
         
    $str addslashes($str);
        }
     
    $str strip_tags(htmlspecialchars($str));
     return 
    $str;
    }
    I had the exact same thing on a different host and it worked but when I switched it gave me these errors...
    Last edited by Trigs; 16-03-2009 at 11:24 PM.
    Vouches
    [x][x]

  2. #22
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I'm not even going to comment on how horrible that code is.

    Post the code for the page that presents the error, or give me the link to config.php page.

  3. #23
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Shouldnt declare so many variables unless you're going to use them each time you load your config page.
    Hi, names James. I am a web developer.

  4. #24
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    nvm, fixed it. also a question,

    If I do;

    require 'config.php';
    require 'home.php';

    and I had a function in config.php, would I be able to use it in home.php without requiring config.php in home.php?
    Vouches
    [x][x]

  5. #25
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    "and I had a function in config.php, would I be able to use it in home.php without requiring config.php in home.php?"

    Can I call my Dad on my home phone which isn't connected to a telephone line?

    No you can't, you need to require/include it in the file inorder to use it.
    Hi, names James. I am a web developer.

  6. #26
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quit. Putting. *******. Functions. In Your Config File.

    ---------

    Lets say you have this.

    config.php - includes database details/connection, etc.
    functions.php - includes your clean function and some other things.
    home.php - home file.

    here's the code on config.php:

    PHP Code:
    <?php
    require_once "functions.php";
    ?>
    here's the code on home.php:

    PHP Code:
    <?php
    include "config.php";  // includes the config file.

    $string $_GET["string"];
    $string clean($string);

  7. #27
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    Quit. Putting. *******. Functions. In Your Config File.

    ---------

    Lets say you have this.

    config.php - includes database details/connection, etc.
    functions.php - includes your clean function and some other things.
    home.php - home file.

    here's the code on config.php:

    PHP Code:
    <?php
    require_once "functions.php";
    ?>
    here's the code on home.php:

    PHP Code:
    <?php
    include "config.php";  // includes the config file.

    $string $_GET["string"];
    $string clean($string);
    or just download a premade user ******* system.

  8. #28
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by Blinger View Post
    or just download a premade user ******* system.
    How does that help anyone learning anything? I'd rather make my own then download a pile of **** that I'm going to spend more time customizing to make it how I want, then actually building it.

  9. #29
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    Quote Originally Posted by Fazon View Post
    nvm, fixed it. also a question,

    If I do;

    require 'config.php';
    require 'home.php';

    and I had a function in config.php, would I be able to use it in home.php without requiring config.php in home.php?
    Yes you can, if you require it in home.php then you will get the error you got before. You can use require_once to stop this happening. Protege you read his post wrong.

  10. #30
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    yeah, i already figured that out.
    Vouches
    [x][x]

Page 3 of 3 FirstFirst 123

Posting Permissions

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