View Full Version : Will pay for someone who can help me solve this issue.
certify
10-10-2001, 08:42 AM
I'm trying to convert my files to PHP but there is something wrong with the this code. Try to register an account, then login and go the the 2 links below, you will notice that from the index.shtml you the system managed to detect that you are login but from index.php you are still not login?? :confused:
This file call the header from header.shtml
http://www.certifyexpress.com/microsoft/index.shtml
<tr>
<td width="100%"><font face="verdana" size="2"> <!--#include virtual="/forum/homelogin.php" -->, <b>Total Registered Members : <font color="#FF3300"><!--#include virtual="/forum/registered.php" --> </b></font></font>
<br>
</td>
This file call the header from header.php
http://www.certifyexpress.com/microsoft/win2kpro/index.php
echo "<td width=100%><font face=verdana size=2> ";
include("http://www.certifyexpress.com/forum/homelogin.php");
echo " <b>Total Registered Members : <font color=#FF3300>";
include ("http://www.certifyexpress.com/forum/registered.php");
echo " </b></font></font>";
echo "<br>";
echo "</td>";
Below are the codes for homelogin.php
require("global.php");
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
echo "<font face=\"verdana\" size=\"2\"> <b>Welcome back, <font color=\"#FF3300\">$username</font> !</b> [<a href=\"http://www.certifyexpress.com/forum/member.php?s=&action=logout\">Logout</a>]</font>";
} else {
?>
<font face="verdana" size="2">You are not login. <b><a href="http://www.certifyexpress.com/forum/pageregister.php?action=login">Login</a></b> or <b><a href="http://www.certifyexpress.com/forum/register.php">Register</a></b></font>
<?
}
?>
Admin
10-10-2001, 08:58 AM
Try this file:
<?php
chdir("/full/unix/path/to/your/forum");
require("global.php");
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
echo "<font face=\"verdana\" size=\"2\"> <b>Welcome back, <font color=\"#FF3300\">$username</font> !</b> [<a href=\"http://www.certifyexpress.com/forum/member.php?s=&action=logout\">Logout</a>]</font>";
} else {
?>
<font face="verdana" size="2">You are not login. <b><a href="http://www.certifyexpress.com/forum/pageregister.php?action=login">Login</a></b> or <b><a href="http://www.certifyexpress.com/forum/register.php">Register</a></b></font>
<?php
}
?>
but change the first line to fit your site.
(to find out that path, upload this page as error.php:
<?php
echo "HI I AM STUPID! :P
?>
and run it in your browser. You should get a Parse error, and it'll give you the full path to that file)
certify
10-10-2001, 09:08 AM
It's still the same. :confused:
I don't understand why it worked in SHTML and not in PHP.
Admin
10-10-2001, 09:17 AM
Because SSI includes files differently.
certify
10-10-2001, 09:29 AM
Ok.
But since it's on PHP why can' it worked? I've tried for almost 1 week now and still can't get it right. :(
certify
10-10-2001, 12:27 PM
Can anybody help?
amykhar
10-10-2001, 12:31 PM
It looks like it's working to me? What's wrong with it?
Amy
certify
10-10-2001, 12:48 PM
Yes it works fine if you are not login or registered but when you are login try go to this url http://www.certifyexpress.com/microsoft/win2kpro/index.php and you will notice that there is no Welcome back yourusername but instead the same you are not login is displayed. Then try to go http://www.certifyexpress.com/microsoft/index.shtml and you will notice the sign Welcome yourusername is displayed.
amykhar
10-10-2001, 12:59 PM
For me, it doesn't work on my machine if I use the url to the include file and not the path.
If I use include "global.php"; it works.
If I use include "http://www.eaforums.com/global.php"; it doesn't work.
Thus, I haven't found a way for me to make this work across my domains. (yet)
Amy
Dunno if this is it, but I had problems with inclusion when including a PHP file that included an other file.
certify
10-10-2001, 01:10 PM
It's on the same domain and I've tried to copy homelogin.php codes and paste them into header.php so there is less include but it turns out to have the same result. I've trying to solve this for almost 1 week now with no answer.
Is there anything to do with my server settings? It's on Apache with plesk.
amykhar
10-10-2001, 01:12 PM
My point is that this line include("http://www.certifyexpress.com/forum/homelogin.php");
might work if it were this instead:
include("forum/homelogin.php");
Amy
certify
10-10-2001, 01:35 PM
I got this error
Warning: Failed opening '/template/header.php' for inclusion (include_path='.:/usr/local/plesk/apache/lib/php')
when I change to
include("forum/homelogin.php");
Path to my header files
/usr/local/plesk/apache/vhosts/certifyexpress.com/httpdocs/template
Path to my win2kpro index file
/usr/local/plesk/apache/vhosts/certifyexpress.com/httpdocs/microsoft/win2kpro
amykhar
10-10-2001, 01:44 PM
you are going to have to modify the include for line for header.php to reflect the directory structure in relation to the homelogin.php file.
I assume it should be something like this:
include "../template/header.php";
I am assuming you have directories like this:
http://www.certifyexpress.com/forum
http://www.certifyexpress.com/template
http://www.certifyexpress.com/win2kpro
Now, if what you really have is
http://www.certifyexpress.com/win2kpro/forum
Then, the include would be
include "../../template/header.php";
Amy (crossing fingers)
amykhar
10-10-2001, 02:06 PM
oops. I forgot the microsoft directory. add another ../ to the path. :D
Amy
certify
10-10-2001, 02:42 PM
Microsoft index.php file workes. :) But in my template header.php file I keep getting this error
Warning: Failed opening '../forum/homelogin.php' for inclusion (include_path='.:/usr/local/plesk/apache/lib/php') in /usr/local/plesk/apache/vhosts/certifyexpress.com/httpdocs/template/header.php on line 92
amykhar
10-10-2001, 03:12 PM
you missed a couple of ../../ See my previous posts.
The idea is that you need to browse to the directory that branches off to the forum directory.
Amy
certify
10-11-2001, 03:06 AM
Ok I manged to get it working now, thanks to Amy. :)
But now it keep getting this message. :confused:
Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/certifyexpress.com/httpdocs/template/phpheader/beatestheader.php:3) in /usr/local/plesk/apache/vhosts/certifyexpress.com/httpdocs/forum/admin/functions.php on line 1459
BradC
10-11-2001, 03:52 AM
just seen this..
I get that header error when I put in html code for the title and everything inside a file..
cause it is already there... hint ($BBname - powered by VB..)
so try to find the <title></title> code and take it out.. see if that helps.
certify
10-11-2001, 08:33 AM
Thanks a bunch!! I worked. :D
Now I can sleep .... :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.