AIM profile

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

kmano
Forum Newbie
Posts: 7
Joined: Thu Jan 22, 2004 11:02 pm

AIM profile

Post by kmano »

I used to program in PHP ages ago, but for the last year have been using Assembly extensively...so i have very little remembrance on any of it :D I created one of my own aim profiles the other day using "buddyprofile". When i realized how corny this thing was, it had tons of spam in there...plus it wasn't that customizable. I was wondering if you guys...knew how to create a link in an aim profile that'll load the web page into it....like buddy profile does. Also, what kind of PHP is required to do what buddy profile does....i.e. the functions like '%n','%d','%t'....


thanks

andrew
kmano
Forum Newbie
Posts: 7
Joined: Thu Jan 22, 2004 11:02 pm

Post by kmano »

I figured out how to link it, i'm just wondering how to do things like....count how many people go to my profile...and how to save their sn's! :D

Thanks
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

Thats easy... all you do is create a page that will log the user then redirect to main page of profile... and then in your link, add like ?name=%n
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

Did u know that u can also make it open in the AIM Today window? which will give you more features to put into your profile like pictures and sound?
kmano
Forum Newbie
Posts: 7
Joined: Thu Jan 22, 2004 11:02 pm

Post by kmano »

ooOoooo hehe ......how would you do that :-D.....with some examples perhaps?
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

do what? write the page to log the name, or open in AIM Today window?
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

i'm now getting interested, could you show us how to do both
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

to open in AIm Today window, use a link like this:

Code: Select all

<a href=" http://aimtoday.aol.com/redir.adp?at_spot=at_nw1.home.main.mid&url=http://www.YOURADDRESSHERE.com" target="_aim_today">Click Here</A>
then where the YOURADDRESSHERE.com is change to your address with your php file on it, like http://www.somewhere.com/log.php?name=%n

then in your log.php file, all you need is something like:

Code: Select all

<?php
$name = $_REQUEST['name'];

$fn = "log.txt";
$fp = fopen($fn, "a+");
fwrite($fp, $name);
fclose($fp);

?>
and you can also make it add the time and date they visited and also their IP.... Wow, i just started PHP and i'm already teaching other people how to do things :-D cool! But i'm not new to programming, so things sorta come together! When i first found out about this i wrote a site and tried it out with ASP, and got it to work, and i quickly rewote it in PHP the other day!
Have Fun!
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

One small fix, rather than use $_REQUEST, it is better just to specify the method that you know is being used. So:

Code: Select all

<?php
$name = $_GET['name'];

$fn = "log.txt";
$fp = fopen($fn, "a+");
fwrite($fp, $name);
fclose($fp);

?>
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

so let me get this right.....if i use $_GET['name']; it will return the aim user name? that is if your in the aim today window
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

dull, if you put a link in your profile with the link: http://www.mysite.com/info.php?name=%n then the %n will automatically be changed to the AIM screen name of the user when they view your profile. So if your name was PHPluvr then when you clicked on the link it would take you to: http://www.mysite.com/info.php?name=PHPluvr. From there, $_GET is used as it is with any URL.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

ok i got it, sorry sometime i'm alittle dense you'll have to forgive me

*thinks to self*wow are you stupid*thinks to self*
kmano
Forum Newbie
Posts: 7
Joined: Thu Jan 22, 2004 11:02 pm

Post by kmano »

I'm not the admin on the page im using and these are the errors i get
Warning: fopen(log.txt): failed to open stream: Permission denied in /home/ugforumz/public_html/wd/profile.php on line 14

Warning: fwrite(): supplied argument is not a valid stream resource in /home/ugforumz/public_html/wd/profile.php on line 15

Warning: fclose(): supplied argument is not a valid stream resource in /home/ugforumz/public_html/wd/profile.php on line 16
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

That's because you don't have permissions to the file you are trying to read.
kmano
Forum Newbie
Posts: 7
Joined: Thu Jan 22, 2004 11:02 pm

Post by kmano »

It's in the same directory....so how would i change the permissions?
Post Reply