AIM profile
Moderator: General Moderators
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
I host all my own profiles, FREE... apache is free, and php is free and using ChaneIP.com you can get free DDNS services with free domains like http://www.whatever.myddns.com and others.... but its still better than someone else hosting your site!
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
Hi,
I am really into making my own AIM profile.
You can check it out.. AIM: w0lverne
Anyway, I need some help with some code.
I have this code, that gets the users screenname, time and date, and IP address. The screenname and IP are correct but I get this error everytime I view the page.
This is what I get when I click on the link in my profile. It almost works... 
I got this code from evilwalrus.com. There were many mistakes in the code, that I have had to fix. But it isn't perfect yet. I think that I need to create a table into the database. But I am not sure what to name it, what fields to have in it.
If you could provide some code, that would be great!
Thanks, th3gh05t
I am really into making my own AIM profile.
You can check it out.. AIM: w0lverne
Anyway, I need some help with some code.
I have this code, that gets the users screenname, time and date, and IP address. The screenname and IP are correct but I get this error everytime I view the page.
Here is the code that I using:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/derek/www/profile/aim.php on line 45<br />
Code: Select all
<?php
// AIM Automatic-Answering Machine/Logger v1.0
//
// Code in your aim profile should look like this:
//<A HREF="http://www.halo-source.com/aim.php?T4=%n"
// TARGET="_self">Click Here</a>
//
// get user's IP Address
$userip = getenv("REMOTE_ADDR");
//mysql information
$dbusername='derek';
$dbpassword='*********';
$hostname='localhost';
$databasename='aim';
// connect
$link1 = mysql_connect($hostname, $dbusername, $dbpassword);
//get db
if (!mysql_select_db($databasename, $link1)) {
echo "error with db";
exit();
}
// get current time and date
$time1 = date("h:i a");
$date1 = date("d/m/Y");
// sql statement to insert values
$addstmt = "Insert into tablename(ip, time, date, screenname) values('%s', '%s', '%s', '%s')";
// code in case there is an error inserting
if (!mysql_query(sprintf($addstmt, $userip, $time1, $date1, $T4), $link1)) {
$flag1 = 1;
}
// sql to check to see how many times the user has viewed the profile
$result = mysql_query("select * from aimlist where screename = '".$T4."'");
// count the number of recs
$countthis = 0;
while ($row = mysql_fetch_array($result)) {
$countthis = $countthis + 1;
// you can do other things in here as well
// such as print out all the dates and times the user has viewed
}
// now print out the personalized message for each user
// you can easily put this in another table
// this will be done in the next version
echo "<BR>You have looked at my profile ${countthis}";
echo "times.<BR>";
echo "Screenname: <b>${T4}</b><BR>";
echo "IP: <b>${userip}</b><BR>";
echo "</body>";
echo "</html>";
?>You can see that the "You looked at my profile X times.", isn't working either..<br />
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/derek/www/profile/aim.php on line 45<br />
You have looked at my profile 0times.
Screenname: w0lverne
IP: 24.199.6.***
I got this code from evilwalrus.com. There were many mistakes in the code, that I have had to fix. But it isn't perfect yet. I think that I need to create a table into the database. But I am not sure what to name it, what fields to have in it.
If you could provide some code, that would be great!
Thanks, th3gh05t