close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple Domains - No solutions work

Thread began 7/05/2010 3:37 pm by phoyer313083 | Last modified 7/09/2010 7:10 am by Jason Byrnes | 1815 views | 5 replies |

phoyer313083

Multiple Domains - No solutions work

I am trying to get two different domains with two different Google API keys to work. I have tried the two PHP solutions in other threads in this form, the Google javascript solution, and other javascript solutions found through a Google search. None work. When I display the page, all I get is the error message saying the saying the domain needs an API key. The web hosting is 1 & 1 using a Linux server. Any help coming up with a solution would be appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

please post a link to each of the two pages and the code you are using so I can examine what is wrong.

Sign in to reply to this post

phoyer313083

Sorry for not getting back with you yesterday. I had a meeting after work. The first thing I tried was:

<script type="text/javascript" src="google_javascript/wagmp_map_14.js">/*wagmp*/</script>
<?php
switch ((isset($_SERVER["SERVER_NAME"]))?$_SERVER["SERVER_NAME"]:"") {
case "www.atlantasinglesgolf.com":
$key = "ABQIAAAA_hh3SY5PFw7FaZnZc_GE8BTU7MCzZCeLoxH0VKX7ffetWjYcUhQ06yq2HnOxNdpxS65um3bz63yxtg";
break;
case "www.asgaatlanta.com":
$key = "BQIAAAA_hh3SY5PFw7FaZnZc_GE8BT-0cRtB7JP2p2BDDXM_yBQn3Gx2BRjSQGnx5e2yh-WKG8dTy0S9yZRBw";
break;
default:
$key = "ABQIAAAA_hh3SY5PFw7FaZnZc_GE8BTU7MCzZCeLoxH0VKX7ffetWjYcUhQ06yq2HnOxNdpxS65um3bz63yxtg";
break;
}
?>
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $key; ?>">/*wagmp*/</script>

This was tried with and without the www.

Then I tried (with and without www.):

<script type="text/javascript" src="google_javascript/wagmp_map_14.js">/*wagmp*/</script>
<?php echo((isset($_SERVER["HTTP_HOST"]))?$_SERVER["HTTP_HOST"]:"") ?>
<?php
switch ($_SERVER["HTTP_HOST"]) {
case "atlantasinglesgolf.com":
$key = "ABQIAAAA_hh3SY5PFw7FaZnZc_GE8BTU7MCzZCeLoxH0VKX7ffetWjYcUhQ06yq2HnOxNdpxS65um3bz63yxtg";
break;
case "asgaatlanta.com":
$key = "BQIAAAA_hh3SY5PFw7FaZnZc_GE8BT-0cRtB7JP2p2BDDXM_yBQn3Gx2BRjSQGnx5e2yh-WKG8dTy0S9yZRBw";
break;
default:
$key = "ABQIAAAA_hh3SY5PFw7FaZnZc_GE8BTU7MCzZCeLoxH0VKX7ffetWjYcUhQ06yq2HnOxNdpxS65um3bz63yxtg";
break;
}
?>
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $key; ?>">/*wagmp*/</script>

This works with atlantasinglesgolf.com but not asgaatlanta.com:

<script type="text/javascript" src="google_javascript/wagmp_map_14.js">/*wagmp*/</script>
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA_hh3SY5PFw7FaZnZc_GE8BTU7MCzZCeLoxH0VKX7ffetWjYcUhQ06yq2HnOxNdpxS65um3bz63yxtg">/*wagmp*/</script>

Any help would be appreciated.

Thanks...Pat

Sign in to reply to this post

Jason ByrnesWebAssist

please post a link to the map page for both domains.

Sign in to reply to this post

phoyer313083

A link that the map display's is:

Bentwater.html

A link that the map does not display is:

Bentwater.html

The page is the same as both domains use the same web hosting site and the html in the page is using the html built by Pro Maps for Google.

Sign in to reply to this post

Jason ByrnesWebAssist

looks like the host does not define the HTTP_HOST variable.


add the following to the page just after the <body> tag to see which server variables are getting set:

php:
<pre><?php var_dump($_SERVER); ?></pre>




use that to find a server variable that is being set by the host that can be used in the if statement.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...