1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP Warning: define() expects at least 2 parameters, 1 given in

Discussion in 'PHP' started by SEO Velvet INC, Oct 23, 2011.

  1. #1
    Hi
    i swtiched hosting companies
    And now i'm finding these things in error_log that i think its causing alot of things to go bad on the website, including not forcing the users to login anymore ebfore seeing content, some bases dont load
    here's the error

    [23-Oct-2011 17:05:25] PHP Warning:  define() expects at least 2 parameters, 1 given in /home/ffffsu/includes/init.php on line 6
    [23-Oct-2011 17:05:25] PHP Warning:  define() expects at least 2 parameters, 1 given in /home/ffffsu/includes/init.php on line 7
    [23-Oct-2011 17:05:25] PHP Warning:  define() expects at least 2 parameters, 1 given in /home/ffffsu/includes/init.php on line 8
    [23-Oct-2011 17:05:25] PHP Warning:  define() expects at least 2 parameters, 1 given in /home/ffffsu/includes/init.php on line 9
    [23-Oct-2011 17:05:25] PHP Warning:  define() expects at least 2 parameters, 1 given in /home/ffffsu/includes/init.php on line 10
    [23-Oct-2011 17:05:25] PHP Warning:  define() expects at least 2 parameters, 1 given in /home/ffffsu/includes/init.php on line 11
    Code (markup):
    here's init.php

    <?php
    /** define real path */
    $path = str_replace('init.php','',realpath(__FILE__));
    $root = str_replace('includes/','',$path);
    /** DOMAIN needs changing */
    define('DOMAIN')	        ? null : define('DOMAIN',           'XXXXX.su');
    define('DS') 		        ? null : define('DS',               DIRECTORY_SEPARATOR);
    define('ROOT')              ? null : define('ROOT',             $root);
    define('WEB_ROOT')          ? null : define('WEB_ROOT',         $root.'public_html');
    define('LIB_PATH')          ? null : define('LIB_PATH',         $path);
    define('WEB_PATH')          ? null : define('WEB_PATH',         'http:'.DS.DS.DOMAIN.DS);
    
    #special 
    
    #main functions
    require_once(LIB_PATH."functions.php");
    #database functions functions
    require_once(LIB_PATH."database.php");
    #system functions
    require_once(LIB_PATH."session.php");
    #extra functions
    require_once(LIB_PATH."user.php");
    #custom functions
    require_once(LIB_PATH."tbl.php");
    
    ?>
    Code (markup):
    anybody any help?
     
    SEO Velvet INC, Oct 23, 2011 IP
  2. fortehlolz

    fortehlolz Banned

    Messages:
    111
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    <?php
    /** define real path */
    $path = str_replace('init.php','',realpath(__FILE__));
    $root = str_replace('includes/','',$path);
    /** DOMAIN needs changing */
    define('DOMAIN',           'XXXXX.su');
    define('DS',               DIRECTORY_SEPARATOR);
    define('ROOT',             $root);
    define('WEB_ROOT',         $root.'public_html');
    define('LIB_PATH',         $path);
    define('WEB_PATH',         'http:'.DS.DS.DOMAIN.DS);
    
    #special 
    
    #main functions
    require_once(LIB_PATH."functions.php");
    #database functions functions
    require_once(LIB_PATH."database.php");
    #system functions
    require_once(LIB_PATH."session.php");
    #extra functions
    require_once(LIB_PATH."user.php");
    #custom functions
    require_once(LIB_PATH."tbl.php");
    
    ?>
    PHP:
    The ternary operator method isn't really needed.....
     
    fortehlolz, Oct 23, 2011 IP