473,224 Members | 1,624 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,224 software developers and data experts.

includes across sub domains

I have a site www.mysite.com.
I have 3 subdomains sub1.mysite.com, sub2.mysite.com and
sub3.mysite.com.
sub3.mysite.com is password protected.
All pages end with .php (ie index.php)
I use the following code:

<?php
include("inc23.inc");
?>

I find that I will require some of the same includes in more than one
subdomain.
Can I do the following?

1) Create a subdomain called resources.mysit.com with 3 folders - images,
includes and stylesheets
and use

A.

<?php
include("resources.mysit.com/includes/ inc23.inc");
?>

B.

<link rel="stylesheet" type="text/css"
href="resources.mysit.com/stylesheets/stylesheetraw.css" />
Instead of
<link rel="stylesheet" type="text/css" href="stylesheetraw.css" />

C.

In my style sheet use

#toparea {background-image: url(resources.mysit.com/images/images/gs1.gif);
etc
instead of
#toparea {background-image: url(images/gs1.gif); etc

D

Does the fact that one of my subdomains is password protected complicate
anything?

Thank you
Jul 17 '05 #1
1 1628
the include() set of functions require a local-filesystem path. To get
around the same problem as you I have a config file that holds the full
path to my public_html folder (parent of subdomains as they are just
folders there too.) and include this path and then the relative path to
the subdomain's script.

For example...

/home/domains/blah.com/public_html/ .. is my fullpath right ? you can
find yours out by looking on your phpinfo.php page it should be on
there somewhere towards the bottom.

so I store this path in a variable and can call it like so...

$fullPath . "subdomain1/config/another.php"

which will work from any of your subdomains because at the end of the
day they're all on the same filesystem.

Hope this helps,
-Dan Morris

Jul 17 '05 #2

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

Similar topics

1
by: d.schulz81 | last post by:
Hi all, We have about 10 different domains that are linked very closely and we want to identify and keep track of every single user that surfs our websites by the use of sessions. The problem...
2
by: Keon | last post by:
Hoi Is it possible to use cookies between different domains? For my site I use 2 domains; the first for my global site with ASP en HTML the second is for my forum located on "hyperboards" a...
4
by: Le | last post by:
Hello I was wondering if there was a way to keep a user's session info across multple domains For example, company A owns website www.a.com and www.b.com. A user logs into www.a.co and later...
2
by: googleboy | last post by:
I have created a html-page with formelements that via a javascript get their data from an iframe that calls a external XLM-page. The solution works in MS Explorer, but only if the browser security...
0
by: Suresh | last post by:
Hi, Problem Description: How to share Session between ASP and ASP.Net across the domains. Microsoft has given an article on session sharing between ASP and ASP.Net. It workd fine if both ASP...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
1
by: ozgur uksal | last post by:
hi, Is there any way to upload data across domains? In other words, assume you own two domains on the same server, and the first domain, that your client visits to upload data, is going to be...
13
by: Samir Chouaieb | last post by:
Hello, I am trying to find a solution to a login mechanism for different domains on different servers with PHP5. I have one main domain with the user data and several other domains that need...
9
by: Josh | last post by:
I run a Joomla website and am familiar with php in some but not all aspects. Currently I am trying to find some solutions related to session handling. Am I correct in saying that "login" is kept...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.