PJ Hile

Don’t worry, I’m from the Internet.

PJ Hile header image 4

Entries Tagged as 'PHP'

Ignoring CakePHP’s tmp/ directory with Subversion

July 30th, 2008 · 2 Comments

I’ve noticed on many occasions that I’ll start a project with a Subversion repo and immediately add/commit all the files included with Cake’s nightly build including the tmp/ directory.  If you’ve ever done this, you’ll know it’s kind of a pain always having those cache/log files showing up when you commit.  So, for my benefit, [...]

[Read more →]

Tags: CakePHP · PHP · Subversion

Putting a Google Map on your site with PHP: Part 1

March 24th, 2008 · 1 Comment

The first step in getting a Google map on your site is to get the latitude and longitude coordinates of all the points you want to show. I get my coordinates using geocoding in the Google Maps API. In order to use the Google Maps API, you must sign up for a free [...]

[Read more →]

Tags: Google · PHP

Javascript strings over multiple lines from PHP

March 13th, 2008 · No Comments

I had a problem where I was defining javascript variables from php variables, and the php variables had multiple lines.
So, a function like this:
function SomeFunction() {
var variable = “<?php echo $variable; ?>”;
}

was creating this:
function SomeFunction() {
var variable = “The first row.
The second row.
The third row
“;
}

The fix was to replace all the ‘\n’ with ‘\\n’, so [...]

[Read more →]

Tags: Javascript · PHP