473,396 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

root path problem

Hi, can anyone quickly solve this little problem please?
I need to reference my $phpbb_root_path but none of the examples
offered work because I'm using a subdomain. My phpbb is at root level,
e.g. mydomain.com/ and the page I want to execute a call from is at
newpages.mydomain.com/
Rather than try to work through the ../../ hierarchies I thought I'd
instead give a fixed URL reference for it, but that doesn't seem to
work either -
<?php
$phpbb_root_path = 'http://www.mydomain.com';
gives me the error "$phpbb_root_path is wrong and does not point to
your forum."

Mar 2 '07 #1
3 5233
you would need to find the real path of your root directory while on the
main domain, and then use it while on the subdomain
ie, on root it might be something like (use $_SERVER['DOCUMENT_ROOT'] to get
the value)

/var/home/websitename/public_html/

just use that document root you get from the main domain and it should work.

hope this helps

"nutz" <mi*******@ntlworld.comwrote in message
news:11**********************@z35g2000cwz.googlegr oups.com...
Hi, can anyone quickly solve this little problem please?
I need to reference my $phpbb_root_path but none of the examples
offered work because I'm using a subdomain. My phpbb is at root level,
e.g. mydomain.com/ and the page I want to execute a call from is at
newpages.mydomain.com/
Rather than try to work through the ../../ hierarchies I thought I'd
instead give a fixed URL reference for it, but that doesn't seem to
work either -
<?php
$phpbb_root_path = 'http://www.mydomain.com';
gives me the error "$phpbb_root_path is wrong and does not point to
your forum."

Mar 4 '07 #2
nutz wrote:
Hi, can anyone quickly solve this little problem please?
I need to reference my $phpbb_root_path but none of the examples
offered work because I'm using a subdomain. My phpbb is at root level,
e.g. mydomain.com/ and the page I want to execute a call from is at
newpages.mydomain.com/
Rather than try to work through the ../../ hierarchies I thought I'd
instead give a fixed URL reference for it, but that doesn't seem to
work either -
<?php
$phpbb_root_path = 'http://www.mydomain.com';
gives me the error "$phpbb_root_path is wrong and does not point to
your forum."
I'm not clear exactly what you're trying to do. What kind of call are
you trying to make?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 4 '07 #3
nutz wrote:
: I need to reference my $phpbb_root_path but none of the examples
: offered work because I'm using a subdomain. My phpbb is at root level,
: e.g. mydomain.com/ and the page I want to execute a call from is at
: newpages.mydomain.com/
:
: Rather than try to work through the ../../ hierarchies I thought I'd
: instead give a fixed URL reference for it, but that doesn't seem to
: work either -
:
: $phpbb_root_path = 'http://www.mydomain.com';
:
: gives me the error "$phpbb_root_path is wrong and does not point
: to your forum."

Sounds like $phpbb_root_path is a variable from a pre-built forum
configuration.

Perhaps the best way to handle this is something along the lines of
adding some code to redirect to the subdomain (if someone tries to
go to http://www.example.com/myforum/) then set that variable to
the subdomain name.

<?php
$sValidServerName = "subdomain.example.com";
$sServerName = $_SERVER['SERVER_NAME'];

if ($sServerName !== $sValidServerName) {
header("Location: http://subdomain.example.com/");
exit;
}
$phpbb_root_path = "http://subdomain.example.com/";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
....

That's the best interpretation pondered here.

--
Jim Carlock
Post replies to the group.
Mar 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: William Starr Moake | last post by:
Another problem with absolute paths in the WYSIWYG editor I'm putting together. The function to toggle between WYSIWYG and HTML modes works except for one glitch. If you use a relative path for...
4
by: gnah | last post by:
Greetings, I hope my problem is easy to fix, I'm pretty new with php - but I am getting weird results with the opendir() function. It may just be a path problem, but I don't see which variable...
2
by: Steve Peterson | last post by:
Hi This is probably the bozo question of the year, but I can't seem to find it in the KB in VS for the life of me. I need to know how to get the full UNC path to my web application (ie C:/Intet...
1
by: Calvin X | last post by:
Hi All, I am getting the following error when I try to open an xml file that is in a directory just underneath the site root. 'Could not find a part of the path...
2
by: hb | last post by:
Hi, Recently I read some articles about the root path reference in ASP.Net application. One recommended way is to use "~" at the beginning of the path with server control. for example: <img...
3
by: Dave | last post by:
Hi, since I'm developing on XP and can only have on website, how can you refer to your root application (not web) in your paths? I read for server controls that "the ~/ prefix will be converted...
2
by: anyeone | last post by:
This one is going to be hard to explain so please bear with me. I have a web project in folder "myapp". This is where the web config lives. I've set this to be the IIS webroot. The file...
0
by: ad | last post by:
We can use Request.PhysicalApplicationPath to get the root path in Web application. But the Request can't be used in WebService. How can I get the root path of WebService?
1
by: gnewsgroup | last post by:
I have a user control called Footer.ascx, in which a background image is inserted like so: <div id="footerdiv" style="background-image:url('Images/ mybackground.jpg');...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.