The problem

If you have insalled wordpress somewhere other than the root of your site how can you access the wordpress functions on a non wordpress page? So for example I had installed wordpress at ww.mydomain.com/wp/ but I wanted to access the wordpress functions on a page at www.mydomain/nonwordpress.php

The solution

Took me a little while to work this out and I tried lots of different methods but then I discovered simply adding in a call to the wp-blog-header.php did the trick, I actually replaced my own db connect as the wp-blog-header.php will connect you to the wp database, luckily for me my sites database was the same as the wordpress one.

So on the page you need the wordpress functionality simply include:

require('wp/wp-blog-header.php'); // wp is the location your installation of wordpresss

This helped me anyway, hope it helps someone else too.