Follow this guide if you want to integrate this with an existing script
Head over to the Last.fm site and apply for an API account, really easy to sign up and I got a key straight away.
Using the provided schema.sql file in the download create the database and appropriate tables, if your hosting provider creates the database for you just use the statements to create the tables
Open up the php/config.inc.php file and insert your database and Last.fm API keys:
// define database settings define('HOSTNAME','localhost'); define('DB_USERNAME','DATABASE_USERNAME_GOES_HERE'); define('DB_PASSWORD','DATABASE_PASSWORD_GOES_HERE'); define('DB_NAME','song_requests'); // defin Lastfm settings define('LASTFM_API_KEY','KEY_GOES_HERE'); define('LASTFM_SECRET_KEY','KEY_GOES_HERE');
Include the config PHP file at the very top of the page you want the track request to appear:
Finally copy & paste the following HTML onto the page you want the track request: