log viewer screennames from AIM

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
westdamron
Forum Newbie
Posts: 5
Joined: Thu Oct 30, 2003 11:49 pm

log viewer screennames from AIM

Post by westdamron »

I no basically nothing about PHP, but I was wondering if there is a way to create a link in an AIM profile, which would use the %n feature to log screennames once they visit the link. I would find it preferrable if the data could be stored in a txt file.

for example in my profile it might have a link to "www.site.com/page.php?name=%n" which would then translate to "www.site.com/page.php?name=friend1223" or whatever. I would then want the friend1223 part to be logged in the txt file for me or others to view.

as i mentioned before, i no basically nothing about PHP, and I dont even know if this would be possible or not...just a question.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Yeah, it is possible.

I suggest storing to a database though. You can then save and edit more material faster and easier than flat text files.

This is a good project to kick-off your php learning. May I recommend a good book or exploring some online tutorial sites to learn the basics. Then explore the MySQL functions and database connection side of php, and from there you should easily know how to do what your asking.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Even if you know nothing about PHP, your logic is good so far.

You'll find eventually though, even if you don't have enemies (friends think its funny too..), that you'll get bad things left for screen names

Most people copy the link from AIM by right clicking and copying the hyperlink, then they change the value in the URL to whatever they want.

I'm working on that problem now though, I'm thinking if it reads their browser as anything besides AIM (mozilla, IE, Netscape, etc..), then it won't add their link to the database/text file.

Thing is, PHP isnt very nice about it, except "get_browser();" which my host hasnt uncommented (in php.ini).. :(

I think just doing it in javascript may work though..
Bennettman
Forum Contributor
Posts: 130
Joined: Sat Jun 15, 2002 3:58 pm

Post by Bennettman »

If you do something like this, it won't work when the AIM SN has a space (or more than one) in. The AIM profile browser doesn't encode it to hex and it brings up an error when you click on the link. It CAN be fixed by some working with the Apache settings, which I'm pretty sure is what AIM profile sites do.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

"Subprofile"
"You can't have spaces in your screen name to access it."

:D


http://www.404-design.net/subinfo.php?sn=%n

^saves sn to text file, then includes it to the bottom

but look at the screen names (after the first 10 or so legit ones, it's just a bunch of stupid crap)
westdamron
Forum Newbie
Posts: 5
Joined: Thu Oct 30, 2003 11:49 pm

Post by westdamron »

Im not as much worried about people spamming me or typing in fake sn's, but if theres a way to get around those too that would be cool. thanks a lot for the help.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

My subprofile code:

You can get ideas and stuff from it but plz dont steal it all.. it took me a while :P

Code: Select all

<html>
<head>
<LINK REL="stylesheet" HREF="style.css" TYPE="text/css">
</head>
<body bgcolor="#000000">
<font color="#FFFFFF" face="verdana" size="1">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var navName = navigator.appName;
if(navName == "Microsoft Internet Explorer")
{
   window.location = "error.php?e=browser";
}
//  End -->
</script>
<?PHP
$maincontent = <<<MC
Welcome to my cool arse subprofile $sn!<br>
I Love You Kate..<br><br>
People who have viewed it:<br>
MC;
if(isset($sn)) {
   $link = "<a href="aim:goim?screenname=$sn&message=Justin+is+the+coolest!">$sn</a>";
   $sn_file = fopen("sns.txt", "a");
   fwrite($sn_file, "$link <br>\n");
   fclose($sn_file);
   echo $maincontent;
   include ("sns.txt");
}
else {
   echo "Don't be an idiot.";
}
?>
</font>
</body>
</html>
Last edited by d3ad1ysp0rk on Sat Nov 01, 2003 12:58 pm, edited 1 time in total.
westdamron
Forum Newbie
Posts: 5
Joined: Thu Oct 30, 2003 11:49 pm

Post by westdamron »

Thanks, that seems like it should work pretty good. My problem is mostly with writing the code. I can read code pretty well, but can't seem to write it. If anyone knows of a good resource, whether its a book or a website, where i could learn how to WRITE php that would help a lot. thanks.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

writing PHP is just knowing the syntax and the functions, which is also what I have trouble with

oh, and logic :P

i basically learned from http://www.php.net and this forum
Cruzado_Mainfrm
Forum Contributor
Posts: 346
Joined: Sun Jun 15, 2003 11:22 pm
Location: Miami, FL

Post by Cruzado_Mainfrm »

even if you learn from php.net manuals, it is 10 times better that u read a book in php, PHP Bible for example
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Cruzado_Mainfrm wrote:even if you learn from php.net manuals, it is 10 times better that u read a book in php, PHP Bible for example
Not true. Books or the Web it doesn't matter. I've learnt all my PHP from the web.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

even if you learn from php.net manuals, it is 10 times better that u read anything else
that on the other hand, is. :P

I find the php.net manuel pretty hard to understand when you're a begginer.. it's nice to look up things with, but it's a very difficult thing to learn from

I just use google to search for different PHP tutorials
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

I was talking about the web in general not just the php.net manual :wink:
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

yea i know :P


can anyone give me a list of outputs for "navigator.appName"

I don't really want to download every browser just to add the names of each one to the if statement..

thanks
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I like books because writers tend to break everything down in terms easily understandable rather than lengthy documentation. Either way is fine though.

[big_search]php introduction[/big_search]
Post Reply