AIM syntax to use in webpages html and php

Php code to see if a user is online:

function getaim($screenname) {
$ch = curl_init();
$url = "http://big.oscar.aol.com/$screenname?on_url=true&off_url=false";
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$result    = curl_exec($ch);
curl_close($ch);
if(eregi("true",$result)) {
return true;
} else {
return false;
}
}

if(getaim($screenname) == true){

echo '<a href="aim:goim?screenname='.$screenname.'&message=Web+user+wants+to+chat" title="iChat/AIM with '.$screenname.'">Instant Messenger</a>'

}

These are the options available initiate an IM session

To use a space
If you want to use a space be sure to place the + symbol where there would normally be a space.
Example: message=Hello,+this+is+a+test! Click Here

Opens a new IM window
aim:goim

Opens a new IM window with a screen name
aim:goim?screenname=SCREENNAME

Opens a new IM window with a screen name and a message
aim:goim?screenname=SCREENNAME&message=MESSAGE

Opens a chat room
aim:gochat?roomname=ROOMNAME

Opens the "Add Buddy" window with a screen name to add
aim:addbuddy?screenname=SCREENNAME

Opens the "Add Buddy" window with a screen and a group name to add
aim:addbuddy?screenname=SCREENNAME&groupname=GROUPNAME

To change someone's buddy icon when they click on the link
aim:buddyicon?src=BUDDYICONURL

To open or receive someone's shared files
aim:getfile?screenname=SCREENNAME

About Keiron

Web Developer based in the UK. Click here if you want to work with me