Page 1 of 2

AIM profile

Posted: Thu Jan 22, 2004 11:02 pm
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

Posted: Fri Jan 23, 2004 1:48 am
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

Posted: Fri Jan 23, 2004 6:27 am
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

Posted: Fri Jan 23, 2004 6:29 am
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?

Posted: Fri Jan 23, 2004 10:07 am
by kmano
ooOoooo hehe ......how would you do that :-D.....with some examples perhaps?

Posted: Fri Jan 23, 2004 3:20 pm
by Illusionist
do what? write the page to log the name, or open in AIM Today window?

Posted: Fri Jan 23, 2004 4:00 pm
by dull1554
i'm now getting interested, could you show us how to do both

Posted: Fri Jan 23, 2004 4:54 pm
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!

Posted: Fri Jan 23, 2004 5:43 pm
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);

?>

Posted: Fri Jan 23, 2004 6:10 pm
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

Posted: Fri Jan 23, 2004 7:41 pm
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.

Posted: Fri Jan 23, 2004 8:01 pm
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*

Posted: Sat Jan 24, 2004 9:02 pm
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

Posted: Sat Jan 24, 2004 10:13 pm
by Straterra
That's because you don't have permissions to the file you are trying to read.

Posted: Sat Jan 24, 2004 11:40 pm
by kmano
It's in the same directory....so how would i change the permissions?