473,224 Members | 1,333 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.

PHP Template

Hi,

I am trying to have 1 template site and have an unlimited number of
websites
using this template site to call there own information.

The sites are exactly the same except for the database, each of the
sites
also needs there own URL, for example one of these urls may be
www.example1.com and the other www.example2.com. These sites are
identical
apart from the database they call to, one will call to a database
called
example1 and the other example2. I want another site (for example
www.solution.com) to read what url has been entered and to pull in the
database for that site (either example1 or example2) and show that
information. I have tried using the CURL library without success (not
sure
how to use it fully) and have tried using frames but had loads of
problems
regarding losing session data. can anyone help?

Thanks
Kev

Oct 25 '06 #1
6 1258
KevinM2k wrote:
Hi,

I am trying to have 1 template site and have an unlimited number of
websites
using this template site to call there own information.

The sites are exactly the same except for the database, each of the
sites
also needs there own URL, for example one of these urls may be
www.example1.com and the other www.example2.com. These sites are
identical
apart from the database they call to, one will call to a database
called
example1 and the other example2. I want another site (for example
www.solution.com) to read what url has been entered and to pull in the
database for that site (either example1 or example2) and show that
information. I have tried using the CURL library without success (not
sure
how to use it fully) and have tried using frames but had loads of
problems
regarding losing session data. can anyone help?
Hi,

The reason you loose your sessiondata is simple: The sessionid is stored in
a cookie together with the domain it belongs to.
Every request to a certain domain send along the cookie, and the possible
ppsessid, and so the server can see if it has a session belonging to that
user.
Imagine what happens if this was not implemented like this (as in early
versions of Netscape): You have 2 windows open, one on
www.wehackforfun.com, and one to your companies intranet. If both sites
receive all cookies, the former one can easily 'steal your session' to your
company's intranetsite, simply by reading the name and value of the
cookie...

If you have 2 different domains, they cannot share a session. (Well, they
can, but that is less straightforward.)

Bottomline, don't try to share sessions across different domains.

If this is really a requirement, you can set this up only if you own both
sites, and let them use a common session storageplace (database eg), AND
let both sites explicitely send the sessionid around via GET, because the
cookie will not work.
I am not sure if that is wise, but it can be done.
Regards,
Erwin Moller
>
Thanks
Kev
Oct 25 '06 #2

Erwin Moller wrote:
KevinM2k wrote:
Hi,

I am trying to have 1 template site and have an unlimited number of
websites
using this template site to call there own information.

The sites are exactly the same except for the database, each of the
sites
also needs there own URL, for example one of these urls may be
www.example1.com and the other www.example2.com. These sites are
identical
apart from the database they call to, one will call to a database
called
example1 and the other example2. I want another site (for example
www.solution.com) to read what url has been entered and to pull in the
database for that site (either example1 or example2) and show that
information. I have tried using the CURL library without success (not
sure
how to use it fully) and have tried using frames but had loads of
problems
regarding losing session data. can anyone help?

Hi,

The reason you loose your sessiondata is simple: The sessionid is stored in
a cookie together with the domain it belongs to.
Every request to a certain domain send along the cookie, and the possible
ppsessid, and so the server can see if it has a session belonging to that
user.
Imagine what happens if this was not implemented like this (as in early
versions of Netscape): You have 2 windows open, one on
www.wehackforfun.com, and one to your companies intranet. If both sites
receive all cookies, the former one can easily 'steal your session' to your
company's intranetsite, simply by reading the name and value of the
cookie...

If you have 2 different domains, they cannot share a session. (Well, they
can, but that is less straightforward.)

Bottomline, don't try to share sessions across different domains.

If this is really a requirement, you can set this up only if you own both
sites, and let them use a common session storageplace (database eg), AND
let both sites explicitely send the sessionid around via GET, because the
cookie will not work.
I am not sure if that is wise, but it can be done.
Regards,
Erwin Moller

Thanks
Kev
Do you have any suggestions on any other way to do this then because I
am completely stuck for ideas.

Thanks

Oct 25 '06 #3

Michael Vilain wrote:
In article <11**********************@e3g2000cwe.googlegroups. com>,
"KevinM2k" <ke******@yahoo.co.ukwrote:
Erwin Moller wrote:
KevinM2k wrote:
>
Hi,

I am trying to have 1 template site and have an unlimited number of
websites
using this template site to call there own information.

The sites are exactly the same except for the database, each of the
sites
also needs there own URL, for example one of these urls may be
www.example1.com and the other www.example2.com. These sites are
identical
apart from the database they call to, one will call to a database
called
example1 and the other example2. I want another site (for example
www.solution.com) to read what url has been entered and to pull in the
database for that site (either example1 or example2) and show that
information. I have tried using the CURL library without success (not
sure
how to use it fully) and have tried using frames but had loads of
problems
regarding losing session data. can anyone help?
>
Hi,
>
The reason you loose your sessiondata is simple: The sessionid is stored in
a cookie together with the domain it belongs to.
Every request to a certain domain send along the cookie, and the possible
ppsessid, and so the server can see if it has a session belonging to that
user.
Imagine what happens if this was not implemented like this (as in early
versions of Netscape): You have 2 windows open, one on
www.wehackforfun.com, and one to your companies intranet. If both sites
receive all cookies, the former one can easily 'steal your session' to your
company's intranetsite, simply by reading the name and value of the
cookie...
>
If you have 2 different domains, they cannot share a session. (Well, they
can, but that is less straightforward.)
>
Bottomline, don't try to share sessions across different domains.
>
If this is really a requirement, you can set this up only if you own both
sites, and let them use a common session storageplace (database eg), AND
let both sites explicitely send the sessionid around via GET, because the
cookie will not work.
I am not sure if that is wise, but it can be done.
>
>
Regards,
Erwin Moller
>

Thanks
Kev
Do you have any suggestions on any other way to do this then because I
am completely stuck for ideas.

Thanks

Uhm. The first fix was free kid. Now we gotta start charging you.

If you can't figure this out, hire a consultant or buy a php book.
There are lots out there. Browse the O'Reilley and Sitepoint sites.

--
DeeDee, don't press that button! DeeDee! NO! Dee...
I am posting on these groups to get this help, not to be told to read
books which aren't going to help in this situation anyway.

I have it so that if you manually set the site id it works, however i
need it to pick this id up depending on what domain you select.

K

Oct 26 '06 #4
KevinM2k wrote:
>Uhm. The first fix was free kid. Now we gotta start charging you.

If you can't figure this out, hire a consultant or buy a php book.
There are lots out there. Browse the O'Reilley and Sitepoint sites.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

I am posting on these groups to get this help, not to be told to read
books which aren't going to help in this situation anyway.

I have it so that if you manually set the site id it works, however i
need it to pick this id up depending on what domain you select.

K
Hi,

Let's get the situation clear. I am still a bit confused.
And I am not charging yet. ;-)

This is what you asked, I putted my questions in:
The sites are exactly the same except for the database, each of the
sites
also needs there own URL, for example one of these urls may be
www.example1.com and the other www.example2.com. These sites are
identical
apart from the database they call to, one will call to a database
called
example1 and the other example2.
Ok, So you have 2 domains.
(The fact that they are similar is not relevant for the problem you have at
hand, I think)

I want another site (for example
www.solution.com) to read what url has been entered
Entered Where?
One the first site, the second, or the www.solution.com?
I think the third, but I am unsure.
Can you explain very clear what you mean here? I am kinda slow today.

If the third, why not send the visitor to the first or second, and start
your session from there?

Or do you want to transmit your sessiondata MADE in the solution.com to one
of the others? (That can be done, and if this is your problem I can explain
how.)
and to pull in the
database for that site (either example1 or example2) and show that
information.

Regards,
Erwin Moller
Oct 26 '06 #5
KevinM2k wrote:
Michael Vilain wrote:
>>In article <11**********************@e3g2000cwe.googlegroups. com>,
"KevinM2k" <ke******@yahoo.co.ukwrote:

>>>Erwin Moller wrote:

KevinM2k wrote:
>Hi,
>
>I am trying to have 1 template site and have an unlimited number of
>websites
>using this template site to call there own information.
>
>The sites are exactly the same except for the database, each of the
>sites
>also needs there own URL, for example one of these urls may be
>www.example1.com and the other www.example2.com. These sites are
>identical
>apart from the database they call to, one will call to a database
>called
>example1 and the other example2. I want another site (for example
>www.solution.com) to read what url has been entered and to pull in the
>database for that site (either example1 or example2) and show that
>information. I have tried using the CURL library without success (not
>sure
>how to use it fully) and have tried using frames but had loads of
>problems
>regarding losing session data. can anyone help?

Hi,

The reason you loose your sessiondata is simple: The sessionid is stored in
a cookie together with the domain it belongs to.
Every request to a certain domain send along the cookie, and the possible
ppsessid, and so the server can see if it has a session belonging to that
user.
Imagine what happens if this was not implemented like this (as in early
versions of Netscape): You have 2 windows open, one on
www.wehackforfun.com, and one to your companies intranet. If both sites
receive all cookies, the former one can easily 'steal your session' to your
company's intranetsite, simply by reading the name and value of the
cookie...

If you have 2 different domains, they cannot share a session. (Well, they
can, but that is less straightforward.)

Bottomline, don't try to share sessions across different domains.

If this is really a requirement, you can set this up only if you own both
sites, and let them use a common session storageplace (database eg), AND
let both sites explicitely send the sessionid around via GET, because the
cookie will not work.
I am not sure if that is wise, but it can be done.
Regards,
Erwin Moller
>Thanks
>Kev

Do you have any suggestions on any other way to do this then because I
am completely stuck for ideas.

Thanks

Uhm. The first fix was free kid. Now we gotta start charging you.

If you can't figure this out, hire a consultant or buy a php book.
There are lots out there. Browse the O'Reilley and Sitepoint sites.

--
DeeDee, don't press that button! DeeDee! NO! Dee...


I am posting on these groups to get this help, not to be told to read
books which aren't going to help in this situation anyway.

I have it so that if you manually set the site id it works, however i
need it to pick this id up depending on what domain you select.

K
Erwin is correct. These groups are to help people learn how to do
things, not to do your work for you. You got a very workable solution -
probably the only way to do it within the limits of security set by the
browsers and protocol. Don't like it? Figure out how to do it
yourself, or pay someone else to do it.

Sound crass? You bet it is. But many of us make our livings off of
writing PHP code. We help here because we like to help others learn how
to do things. But we won't do your job for you for free. We like to
eat, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 27 '06 #6

KevinM2k wrote:
I am posting on these groups to get this help, not to be told to read
books which aren't going to help in this situation anyway.
How do you know that the books aren't going to help in this situation
if you haven't read them!

Oct 27 '06 #7

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

Similar topics

1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
31
by: nikola | last post by:
Hi all, I was working with a simple function template to find the min of two values. But since I would like the two values to be different (type) I dont know what kind of value (type) it will...
5
by: Gianni Mariani | last post by:
The spirit of this arguably pointless exercise, is that the numeric_limits<T> class could be replaced with a totally generic template of compile-time, template computed constants. The problem is...
2
by: Rudy Ray Moore | last post by:
Whenever I get any error with Vc++7.1/.net/2003, it is followed by huge ammounts of "template assistance" error messaging referencing template code (MTL) that has nothing to do with the error. ...
2
by: Alfonso Morra | last post by:
I have a class declared as ff: class __declspec(dllexport) A { public: A() ; A(const A&) A& operator=(const A&) ; ~A() ; void doThis(void) ;
19
by: aaragon | last post by:
Hi everyone. A very simple question. I would like to know what is better in terms of performance. I want to use a simple function to obtain the minimum of two values. One way could be using a...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
45
by: charles.lobo | last post by:
Hi, I have recently begun using templates in C++ and have found it to be quite useful. However, hearing stories of code bloat and assorted problems I decided to write a couple of small programs...
9
by: Leo jay | last post by:
i'd like to implement a class template to convert binary numbers to decimal at compile time. and my test cases are: BOOST_STATIC_ASSERT((bin<1111,1111,1111,1111>::value == 65535));...
2
by: Gary Nastrasio | last post by:
I'm currently reading Andrei Alexandrescu's book "Modern C++ Design" and I'm a bit confused by one bit of template syntax in chapter 1. Here is a code example: template <class CreationPolicy>...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
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...

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.