Web Hosting Talk


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Programming on tow servers with PHP
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.

 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-04-2008, 05:39 AM
webhostbeginner webhostbeginner is offline
View Beta Profile
Web Hosting Evangelist
 
Join Date: Mar 2005
Posts: 499
Programming on tow servers with PHP

Hello,

I have a huge website with some sub domains.
we set each sub domains on a separate servers because each sub domain have high pressure on one server.

Now I have a question.
our user accounting system is located on forum.domain.com on a server, now I want to use the cookies and user information on my another sub domain which located on another server for example test.domain.com.
our forum system is vBulletin , I can access to user information when my another sub domain located on forum server with this code :



require_once("global.php");
$userID = $vbulletin->userinfo['userid'];
$userName = $vbulletin->userinfo['username'];



but I want to know how can I do it when that sub domain not located on the server of forum.


Regards,


Reply With Quote
Sponsored Links
  #2  
Old 08-04-2008, 05:45 AM
Steve_Arm Steve_Arm is offline
View Beta Profile
Community Guide
 
Join Date: Jan 2006
Location: Athens, Greece
Posts: 1,403

__________________
PHP Source Code | I speak code


Reply With Quote
  #3  
Old 08-04-2008, 06:12 AM
ub3r ub3r is offline
View Beta Profile
Disabled
 
Join Date: Dec 2002
Location: chica go go
Posts: 11,858
Not a programming suggestion, but have you considered setting up an NFS mount between each server and setting the php session_savedir variable the same way on each?

Not a good idea unless each server is very close to one another though. It'd be good if they were both on the same internal network with gigabit connectivity though.

Reply With Quote
Sponsored Links
  #4  
Old 08-04-2008, 10:38 AM
qbert220 qbert220 is offline
View Beta Profile
Newbie
 
Join Date: May 2005
Posts: 24
Quote:
Originally Posted by ub3r View Post
have you considered setting up an NFS mount between each server
NFS is not a secure protocol, so make sure you know what you are doing (or get help form someone who does) if you decide to implement this.

Reply With Quote
  #5  
Old 08-04-2008, 10:40 AM
JustinSmall JustinSmall is offline
View Beta Profile
Aspiring Evangelist
 
Join Date: Jan 2005
Location: North-East, Indiana
Posts: 417
that's very weird... he's trying to share cookies yeah???

Won't his cookies be stored as

xxx.com
sub.xxx.com

????
How could he share the cookies in that stand point?

__________________
• PHP5 / MySQL / CUSTOM TEMPLATING / CLEAN & MAINTAINABLE CODING
• WEB DEVELOPMENT via CUSTOM DESIGN / PROGRAMMING


Reply With Quote
  #6  
Old 08-04-2008, 10:45 AM
qbert220 qbert220 is offline
View Beta Profile
Newbie
 
Join Date: May 2005
Posts: 24
I assume the OP is passing the information between the 2 subdomains using a common database. Each subdomain can access the database.

Reply With Quote
  #7  
Old 08-06-2008, 05:37 AM
ub3r ub3r is offline
View Beta Profile
Disabled
 
Join Date: Dec 2002
Location: chica go go
Posts: 11,858
Quote:
Originally Posted by qbert220 View Post
NFS is not a secure protocol, so make sure you know what you are doing (or get help form someone who does) if you decide to implement this.
running it on a local network only would be the best move.

Reply With Quote
  #8  
Old 08-06-2008, 05:49 AM
qbert220 qbert220 is offline
View Beta Profile
Newbie
 
Join Date: May 2005
Posts: 24
Quote:
Originally Posted by ub3r View Post
running it on a local network only would be the best move.
Agreed - This will prevent data being snooped. I was presuming that the server is available over the entire internet. Therefore care must still be taken not to expose NFS mounts to the internet.

Reply With Quote
  #9  
Old 08-06-2008, 12:13 PM
JustinSmall JustinSmall is offline
View Beta Profile
Aspiring Evangelist
 
Join Date: Jan 2005
Location: North-East, Indiana
Posts: 417
Quote:
Originally Posted by qbert220 View Post
I assume the OP is passing the information between the 2 subdomains using a common database. Each subdomain can access the database.
true

I would definitely connect via 'localhost' because you find yourself hurting if your mounts get exposed.

__________________
• PHP5 / MySQL / CUSTOM TEMPLATING / CLEAN & MAINTAINABLE CODING
• WEB DEVELOPMENT via CUSTOM DESIGN / PROGRAMMING


Reply With Quote
  #10  
Old 08-28-2008, 03:36 AM
webhostbeginner webhostbeginner is offline
View Beta Profile
Web Hosting Evangelist
 
Join Date: Mar 2005
Posts: 499
Thanks for replies,

But I cannot use only cookies , because vbulletin recommended we should use global.php for getting user information, so I should include global.php from my another server to my program , can I do it ?


Regards,

Reply With Quote
  #11  
Old 08-28-2008, 04:15 AM
ub3r ub3r is offline
View Beta Profile
Disabled
 
Join Date: Dec 2002
Location: chica go go
Posts: 11,858
Quote:
Originally Posted by webhostbeginner View Post
Thanks for replies,

But I cannot use only cookies , because vbulletin recommended we should use global.php for getting user information, so I should include global.php from my another server to my program , can I do it ?


Regards,
yes, read up on nfs.

Reply With Quote
  #12  
Old 08-29-2008, 07:08 AM
webhostbeginner webhostbeginner is offline
View Beta Profile
Web Hosting Evangelist
 
Join Date: Mar 2005
Posts: 499
Quote:
Originally Posted by ub3r View Post
yes, read up on nfs.
Sorry I cannot understand, would you please explain about your suggestion?

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement: