Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell's Blog:
Retrieving Data from Google Analytics API using PHP
Dec 09, 2010 @ 19:40:32

Lorna Mitchell has a new post to her blog continuing her look at using the Google Analytics API. This time the focus is on pulling data out of the API (if you're looking for connection advice, see her previous post).

Recently I started playing with the google analytics API, looking at ways to bring analytics onto dashboards and generate simple reports from the data in there. Very shortly after I started to look at the API, I had working data retrieval, so I thought I'd share my experiences (and code!).

She mentions the data reference document you can use to find the methods to call for specifically what you want as well as a snippet of sample code to connect and pull data based on a set of "query data".

tagged: google analytics api tutorial retrieve

Link:

ProDevTips.com:
CRUD with PHP Doctrine
Aug 25, 2008 @ 16:19:37

In a fourth part of their series looking at using Doctrine in PHP, the ProDevTips blog moves on to implementing it in a typical CRUD interface.

They create the links between the tables (two hasOne relationships), a search() method to find the destinations for a user, a sorting method to multisort based on the subkeys of the value passed in and the methods for updating the information already in the database.

That's it for now, feel free to download this tiny Smarty and Doctrine framework. Note that for this to work you have to put Smarty and Doctrine in the lib folder. There is a login interface involved, just click submit there without entering anything. There is also an SQL file in the trip_selector folder if you want to try this out with some test data (same as in the picture above).
tagged: doctrine crud relationship update create retrieve delete

Link:

Jaanus' Blog:
How to retrieve remote files in your web apps and still be friends with the server
Jan 18, 2006 @ 13:19:36

In this post on Jaanus' blog today, they show how you can grab remote files from a server and still "remain friends" with the server.

It often happens that when you're building a web page or app, you may want to include some content from a remote server. Say that it's some statistic figure that the remote outputs as HTML or TXT and you then want to retrieve it and either do something with it or directly display as part of your own page. And you're working in PHP.

PHP provides a fancy way of opening and including files directly over HTTP, which they call "URL wrappers". As tempting as it may seem, in the long run doing remote opens with URL wrappers is not the best practice. So here’s what I came up with when needing to do this kind of caching thing in my own scenarios. It requires you have the cURL module installed and that the webserver can read and write from /tmp.

They provide the short script that does the work inside a function (easy to drop into a class), and grabs the remote file, and pulls down to /tmp for the script to use. It even allows you to specify a timeout for the file, forcing the script to grab a new copy every so often...

tagged: retrieve remote files friends with server curl timeout retrieve remote files friends with server curl timeout

Link:

Jaanus' Blog:
How to retrieve remote files in your web apps and still be friends with the server
Jan 18, 2006 @ 13:19:36

In this post on Jaanus' blog today, they show how you can grab remote files from a server and still "remain friends" with the server.

It often happens that when you're building a web page or app, you may want to include some content from a remote server. Say that it's some statistic figure that the remote outputs as HTML or TXT and you then want to retrieve it and either do something with it or directly display as part of your own page. And you're working in PHP.

PHP provides a fancy way of opening and including files directly over HTTP, which they call "URL wrappers". As tempting as it may seem, in the long run doing remote opens with URL wrappers is not the best practice. So here’s what I came up with when needing to do this kind of caching thing in my own scenarios. It requires you have the cURL module installed and that the webserver can read and write from /tmp.

They provide the short script that does the work inside a function (easy to drop into a class), and grabs the remote file, and pulls down to /tmp for the script to use. It even allows you to specify a timeout for the file, forcing the script to grab a new copy every so often...

tagged: retrieve remote files friends with server curl timeout retrieve remote files friends with server curl timeout

Link:


Trending Topics: