Post new topic Reply to topic  [ 7 posts ] 
 Post subject: Include Troubles
PostPosted: 2010-02-05 (03:09) 

Joined: 2010-02-05 (03:00)
Posts: 4
First off, I would like to say this script is very cool. But I am having trouble including the script in my website. Although I have installed the script successfully. I have tried the standard documentation and couldn't resolve any problems with that. When I go to /comments/include.php, I see a blank page (no errors). I am really new to html and stuff so I don't really know where to go from here. Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Include Troubles
PostPosted: 2010-02-05 (11:02) 
Site Admin

Joined: 2003-07-27 (00:49)
Posts: 7357
Of course you don't see anything because that file doesn't contain any output. :-) Did you follow the steps of this page?

http://www.gentlesource.com/documentati ... pt/include

Ralf


Top
 Profile  
 
 Post subject: Re: Include Troubles
PostPosted: 2010-02-05 (21:14) 

Joined: 2010-02-05 (03:00)
Posts: 4
I think I did it all right (at least I tried). My directory structure looks like this:

ROOT -> comments -> include.php
ROOT -> comments -> index.php

My index.php file looks like this:
Code:
<?php include './include.php'; ?>

<html>
   <head><link rel="stylesheet" href="/comments/template/default/style.css" type="text/css" /></head>
   <body><?php echo $c5t_output; ?></body>
</html>


My include.php file looks like this:
Code:
<?php

/**
* GentleSource Comment Script
*
*/


define('C5T_ROOT', '/www//comments/');
include C5T_ROOT . 'comment.php';

?>

I have navigated to both pages and they both have the same two error messages:
Code:
Warning: include(/www//comments/comment.php) [function.include]: failed to open stream: No such file or directory in /www/110mb.com/s/k/y/b/o/m/b/0/skybomb0/htdocs/comments/include.php  on line 10

Code:
Warning: include() [function.include]: Failed opening '/www//comments/comment.php' for inclusion (include_path='.:/usr/share/php') in /www/110mb.com/s/k/y/b/o/m/b/0/skybomb0/htdocs/comments/include.php  on line 10

As I said before, I am very new to HTML and have pretty much no experience in MYSQL or PHP.


Top
 Profile  
 
 Post subject: Re: Include Troubles
PostPosted: 2010-02-07 (00:50) 
Site Admin

Joined: 2003-07-27 (00:49)
Posts: 7357
The path in include.php is not correct.

Code:
define('C5T_ROOT', '/www//comments/');


Some servers output the wrong path. Could you check with following script what the environment variable DOCUMENT_ROOT is saying?

Code:
<?php phpinfo(); ?>


Ralf


Top
 Profile  
 
 Post subject: Re: Include Troubles
PostPosted: 2010-02-07 (18:08) 

Joined: 2010-02-05 (03:00)
Posts: 4
Under the Apache Environment section, I found Document_Root. It says Document_Root is "/www/".


Top
 Profile  
 
 Post subject: Re: Include Troubles
PostPosted: 2010-02-07 (20:14) 
Site Admin

Joined: 2003-07-27 (00:49)
Posts: 7357
That can't be correct. It should be much longer. Could you please ask your webhost where to find the correct DOCUMENT_ROOT and why it isn't displayed correctly.

Best regards

Ralf


Top
 Profile  
 
 Post subject: Re: Include Troubles
PostPosted: 2010-02-07 (22:31) 

Joined: 2010-02-05 (03:00)
Posts: 4
OK, did a little scrounging around the forums and came up with this bit of code:
Code:
<?php
$root = str_replace(str_replace($_SERVER['PATH_INFO'],'',ereg_replace('/+','/',$_SERVER['PHP_SELF'])),'',$_SERVER['SCRIPT_FILENAME']);
print $root;
?>

The value returned on the webpage is "/www/110mb.com/s/k/y/b/o/m/b/0/skybomb0/htdocs". Is this what you were expecting?

Edit: I think that was it. I replaced this line:
Code:
define('C5T_ROOT', '/www//comments/');

with this line:
Code:
define('C5T_ROOT', '/www/110mb.com/s/k/y/b/o/m/b/0/skybomb0/htdocs/comments/');

It seems to work now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
cron

Resources:   Schwerin    Private Krankenversicherung    Krankenversicherung    Website Tools Collection    Speed Camera Database    Radarfallen-Datenbank    Speed Camera Database    Teeny Weeny URL
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Translated by Xaphos © 2007, 2008, 2009 phpBB.fr