close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

API Key invalid

Thread began 11/11/2010 5:25 pm by Daryl | Last modified 11/12/2010 11:24 am by Jason Byrnes | 1798 views | 10 replies |

DarylBeta Tester

API Key invalid

I have used Google Maps a number of times with no problem, however two websites that I have built over the last few days have both had the same problem.

When the page loads, a key error is displayed saying that a new key needs to be obtained.

I got a key from google using the domain as suggested. On one of my sites I obtained a new key 2 or 3 times and eventually it worked, however the other domain I just cant get to work.

Has anyone else had this problem or do you know what is causing me so many problems with such a simple task?

Thanks in advance

Sign in to reply to this post

Jason ByrnesWebAssist

make sure there aren't two instances of the api key in the code, also make sure not to enter any leading or trialing spaced.

Send a link and I should be able to spot the issue.

Sign in to reply to this post

DarylBeta Tester

Hi Jason

Thanks for your reply.

The link is http://qcrpainters.com/contact_us.php

I wll have a look at my code in a few hours and will look out for the issues that you have mentioned.

Sign in to reply to this post

DarylBeta Tester

Ive had a look but cant find either of the issues that you mentioned might be causing my problems.

Sign in to reply to this post

Jason ByrnesWebAssist

I just generated a new key for your domain, the key i got was:
ABQIAAAA6WPOHGcEKA55UdVGw-rYERSS52EQ8WiOjQJUKwBQ1vq6MZQg0hRrq1qc1M1c6U4Ql1dhSs7dPk5Qqg


try changing:

<script type="text/javascript" src="http://maps.google.com/maps?file=api&ampv=2key=ABQIAAAACz9kE5lP_TzF6JhxnHbM0BSS52EQ8WiOjQJUKwBQ1vq6MZQg0hRLm8PjB08vOc74S7qd2fUbIU8jXg">/*wagmp*/</script>



to:

<script type="text/javascript" src="http://maps.google.com/maps?file=api&ampv=2key=ABQIAAAA6WPOHGcEKA55UdVGw-rYERSS52EQ8WiOjQJUKwBQ1vq6MZQg0hRrq1qc1M1c6U4Ql1dhSs7dPk5Qqg">/*wagmp*/</script>





when registering the api key, make sure to use only the domain,
qcrpainters.com/

do not include the page:
contact_us.php

Sign in to reply to this post

DarylBeta Tester

Hi Jason

I am afraid that didn't work either.

Sign in to reply to this post

Jason ByrnesWebAssist

add this code at line 1, what does that return?

php:
<?php echo((isset($_SERVER["HTTP_HOST"]))?$_SERVER["HTTP_HOST"]:""?>
Sign in to reply to this post

DarylBeta Tester

qcrpainters.com

Sign in to reply to this post

Jason ByrnesWebAssist

OK, I see the problem now, you do not have proper ampersands between each of the URL variables in the script source:


<script type="text/javascript" src="http://maps.google.com/maps?file=api&ampv=2key=ABQIAAAA6WPOHGcEKA55UdVGw-rYERSS52EQ8WiOjQJUKwBQ1vq6MZQg0hRrq1qc1M1c6U4Ql1dhSs7dPk5Qqg">/*wagmp*/</script>


look closely at this portion:
maps?file=api&ampv=2key=AB.....

there are three url variables being passed here:
file=api
v=2
key=<key>

these need to be separated by an ampersand character "&" or the ampersand html entity:

&



the semi colon at the end is very important to create the html entity.

your code needs to have the ampersands encoded correctly and they need to be between each argument being passed:

maps?file=api&v=2&key=AB.....
Sign in to reply to this post

DarylBeta Tester

Jason

Thank you for your time and also the explanation!

I think these changes went back to when I was trying to validate the page.

Thanks again.

Sign in to reply to this post
loading

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...