Comments on: What are apikey.php and db_credentials.php? http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/ with PHP or Rails and AJAX: From Novice to Professional Thu, 21 Jul 2011 18:22:45 +0000 http://wordpress.org/?v=2.3.3 By: Ken http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-120308 Ken Sun, 10 Jan 2010 15:17:50 +0000 http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-120308 I'm having trouble with the dbcredentials.php. It's simply displaying the entire text of the database credentials, rather than connecting to the database. Any ideas why this is happening? I’m having trouble with the dbcredentials.php. It’s simply displaying the entire text of the database credentials, rather than connecting to the database. Any ideas why this is happening?

]]>
By: Cam http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-12240 Cam Mon, 03 Sep 2007 12:15:51 +0000 http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-12240 Hi Kevin, The fourth line is the one defining $db_db (the database name for the MySQL database). However, most of our code has a hard coded value instead of this paramter for this -- which was an oversight in the rush to publish. Also there is no image above. It's a code listing with CSS styling. The code is in there for you to see, maybe your browser is doing something silly to cause you to not see the 4th line? Cam Hi Kevin,

The fourth line is the one defining $db_db (the database name for the MySQL database). However, most of our code has a hard coded value instead of this paramter for this — which was an oversight in the rush to publish.

Also there is no image above. It’s a code listing with CSS styling. The code is in there for you to see, maybe your browser is doing something silly to cause you to not see the 4th line?

Cam

]]>
By: Kevin http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-11999 Kevin Wed, 29 Aug 2007 17:46:36 +0000 http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-11999 What is the fourth line of db_credentials.php script? This line is missing from the image you pasted above. Please let us know or correct that above image. Thank you very much, Kevin. What is the fourth line of db_credentials.php script?

This line is missing from the image you pasted above. Please let us know or correct that above image.

Thank you very much,

Kevin.

]]>
By: Matt http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-4242 Matt Wed, 07 Mar 2007 00:06:34 +0000 http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-4242 Hi, I had a little different problem getting this to work, partly because I'm new to PHP and partly because I'm running under IIS. I had to change the syntax of the URL in listing 2-2 from this "key=" ...to this: "key=" Also, when including the apikey.php file, IIS didn't know what DOCUMENT_ROOT was, so I had to use a different path. Just thought I'd pass along what I'd learned in case someone else encounters the problems I did. -Matt Hi,

I had a little different problem getting this to work, partly because I’m new to PHP and partly because I’m running under IIS.

I had to change the syntax of the URL in listing 2-2 from this
“key=”

…to this:
“key=”

Also, when including the apikey.php file, IIS didn’t know what DOCUMENT_ROOT was, so I had to use a different path.

Just thought I’d pass along what I’d learned in case someone else encounters the problems I did.

-Matt

]]>
By: Matt http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-4241 Matt Wed, 07 Mar 2007 00:05:09 +0000 http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-4241 Hi, I had a little different problem getting this to work, partly because I'm new to PHP and partly because I'm running under IIS. I had to change the syntax of the URL in listing 2-2 from this key= ...to this: key= Also, when including the apikey.php file, IIS didn't know what DOCUMENT_ROOT was, so I had to use a different path. Just thought I'd pass along what I'd learned in case someone else encounters the problems I did. -Matt Hi,

I had a little different problem getting this to work, partly because I’m new to PHP and partly because I’m running under IIS.

I had to change the syntax of the URL in listing 2-2 from this
key=

…to this:
key=

Also, when including the apikey.php file, IIS didn’t know what DOCUMENT_ROOT was, so I had to use a different path.

Just thought I’d pass along what I’d learned in case someone else encounters the problems I did.

-Matt

]]>
By: Cam http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-120 Cam Wed, 01 Nov 2006 13:57:27 +0000 http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-120 Hi Remco, Before I answer your questions, your comment led me to find a mistake in my post. I had incorrectly stated that apikey.php contained a single variable declaration of $apikey. I missed the underscore. It should have been $api_key and is now corrected above. Your questions: 1) The complete apikey.php file is the single line of code from above plus the PHP enclosures <?PHP and ?> at the start and end of the file respectively. 2) $_SERVER is a super global and is created by PHP at the start of your script. It is pre-populated with various server related information like which operating system and web server software PHP is running under. It also contains the full path to the start of your web document root relative to the start of the web server's file system. This array element is called 'DOCUMENT_ROOT' and does not need to be changed. It should work in all cases. I hope this helps. Hi Remco,

Before I answer your questions, your comment led me to find a mistake in my post. I had incorrectly stated that apikey.php contained a single variable declaration of $apikey. I missed the underscore. It should have been $api_key and is now corrected above.

Your questions:
1) The complete apikey.php file is the single line of code from above plus the PHP enclosures <?PHP and ?> at the start and end of the file respectively.

2) $_SERVER is a super global and is created by PHP at the start of your script. It is pre-populated with various server related information like which operating system and web server software PHP is running under. It also contains the full path to the start of your web document root relative to the start of the web server’s file system. This array element is called ‘DOCUMENT_ROOT’ and does not need to be changed. It should work in all cases.

I hope this helps.

]]>
By: Remco http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-117 Remco Tue, 31 Oct 2006 18:30:56 +0000 http://www.googlemapsbook.com/2006/10/19/api-key-db-credentials/#comment-117 Hi all, Im reading your book, and I'm trying to make sense of your explanation of the use the apikey.php. Im sorry to say, but I dont understand it. Two questions: 1) what does the complete code of the apikey.php look like? 2) how does this $_SERVER['DOCUMENT_ROOT'] thing work? Do I have to edit it? Thanks in advance. Hi all, Im reading your book, and I’m trying to make sense of your explanation of the use the apikey.php. Im sorry to say, but I dont understand it.

Two questions:
1) what does the complete code of the apikey.php look like?
2) how does this $_SERVER[’DOCUMENT_ROOT’] thing work? Do I have to edit it?

Thanks in advance.

]]>