Jump to content

problem with $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . "/";


@gmail dot com

Recommended Posts

Hi guys I am new and also stuck in this problem $HTTP_SERVER_VARS['DOCUMENT_ROOT']  ...

 

 

i want to edit my website local server

 

here the actual config file

 

<?php

 

$DIR_PATH = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . "/";

$WWW_PATH = "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . "/";

 

$LIB_PATH = $DIR_PATH . 'aplib/';

$INC_PATH = $DIR_PATH . 'inc/';

 

$IMG_PATH = $WWW_PATH . 'images/';

$CSS_PATH = $WWW_PATH . 'css/';

$JS_PATH = $WWW_PATH . 'js/';

$CONFIRMATION_PATH = $WWW_PATH . 'confirmation/';

?>

 

and here the modified config content , because i need to edit the website in a local server

 

<?php

 

$DIR_PATH = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . "/";

$WWW_PATH = "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . "/";

 

$LIB_PATH = $DIR_PATH . 'localhost/www/leolle/aplib/';

$INC_PATH = $DIR_PATH . 'localhost/www/leolle/inc/';

 

$IMG_PATH = $DIR_PATH . 'localhost/www/leolle/images/';

$CSS_PATH = $DIR_PATH . 'localhost/www/leolle/css/';

$JS_PATH = $DIR_PATH . 'localhost/www/leolle/js/';

$CONFIRMATION_PATH = $DIR_PATH . 'localhost/www/leolle/confirmation/';

?>

 

here the view script in index file (calling all the content in config.php)

 

<?php

session_start();

include "config.php";

include $LIB_PATH . "functions.php";

include $LIB_PATH . "hft_image.php";

include $LIB_PATH . "phpMysqlConnection.php";

 

$sql = new phpMysqlConnection($user,$pass,$host);

$sql->SelectDB($db);

include $INC_PATH . "header_inc.php";

?>

 

i already set the register global= On , and already import the sql data base(works fine when i import it via phpMyAdmin)

 

then when i try to execute the index.php the problem begain ....  ???

 

Warning: include(/localhost/www/leolle/aplib/db.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\wamp\www\leolle\config.php on line 67

 

 

Warning: include() [function.include]: Failed opening '/localhost/www/leolle/aplib/phpMysqlConnection.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\wamp\www\leolle\index.php on line 6

 

this just a view waring (total i receive 8 error  ).  :-[

 

 

so my question is

 

whay the local server fail to read the config path ??? , i will so happy if you guys correct my script so i able to execute it in local server

 

thanks guys

 

steven

 

 

<?php

$DIR_PATH = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . "/leolle/";
$WWW_PATH = "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . "/";

$LIB_PATH = $DIR_PATH . 'aplib/';
$INC_PATH = $DIR_PATH . 'inc/';

$IMG_PATH = $WWW_PATH . 'images/';
$CSS_PATH = $WWW_PATH . 'css/';
$JS_PATH = $WWW_PATH . 'js/';
$CONFIRMATION_PATH = $WWW_PATH . 'confirmation/';
?>

I already try it

$DIR_PATH = $_SERVER['DOCUMENT_ROOT'] . "/leolle/";

$WWW_PATH = "http://" . $_SERVER['SERVER_NAME'] . "/";

or

$DIR_PATH = $_SERVER['DOCUMENT_ROOT'] . "/leolle/";

$WWW_PATH = "http://" . $_SERVER['SERVER_NAME'] . "/";

 

, still face with the same issue  ....  any other suggestion ? and also about

 

$WWW_PATH = "http://" . $_SERVER['SERVER_NAME'] . "/"; this is refer in local computer as local host right .

 

cheers

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.