/    Sign up×
Community /Pin to ProfileBookmark

Server Side Scripting Advice Needed

I hope someone can help me with this.

What coding do I need to use to cause different information to display on a page depending upon what url a person used to get to the site?

For instance: A person logs on to our domain from an index page with the .ca extension (globalvolunteers.ca). Through cloaking, it appears they are on a Canadian website, while they are actually being forwarded to our usa site (globalvolunteers.org). Is it possible for a page to display different contact information depending upon whether a person originated from the Canadian website or the USA?

Ie, Canadian Phone number, vs USA phone number? Canadian prices vs American prices. We are trying to avoid having to maintain two completely different websites when so much of the information would be the same.

Thank you so much in advance for any advice.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Phill_PaffordSep 09.2008 — I would suggest looking into the Reserved Variables
Copy linkTweet thisAlerts:
@jim_kellerSep 09.2008 — As Phill mentioned above, you'll wanted to look into the reserved PHP variables, especially $_SERVER. Something like this should work:

[code=php]
<?php

if ( $_SERVER['SERVER_NAME'] == 'mydomain.ca' ) {
//output contact information for the .ca domain
}
else {
//output other contact information
}
?>
[/code]


the Fuse PHP MVC Framework

Why you should be doing your PHP development in FUSE
×

Success!

Help @Shirliana spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...