![]() ![]() |
Feb 1 2004, 08:58 PM
Post
#1
|
|||||||||||||||
|
I'm not drunk! ;D ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1682 Joined: 31-January 04 From: Bentley College Member No.: 7 |
This tutorial shows you how to copy the "imchaos like" buddy name storing from your aol profile. You could use it to create your own subjournal and store buddy's names or just to keep a paranoid account of who clicks your site and has you in their profiles. (Even I do it. :-X) In order for this tutorial to work you need a MySQL database and PHP w/ access to Get variables... (Sometimes it's switched off by free hosts because it can lead to security holes if the users don't watch their code, but the majority leave it open.) Here is the structure of the table... You should, by use of Leo's tutorial, be easily able to just SQL dump this into phpmyadmin
Add this function to the top of your page... Why? It strips away characters which could allow a malicious hacker to manipulate your sql query. AIM doesn't use these characters anyway, so there won't be much of an issue out of it. (While many script kiddies probably couldn't get into your site and it would take a person with knowledge of MySQL and usually some sort of idea of how your database is setup, it's a good idea to close any holes.)
The piece checks the variable and removes the possible security holes... When you load up the link to add the user names right now it's set to www.yoursite.com/yourfolder/yourphpfilethisisin.php?x=name if you wanted to change it to, let's say, y so it would work like www.yoursite.com/yourfolder/yourphpfilethisisin.php?y=name change the $x = strtolower(dbInsans($_GET['x'])); to $x = strtolower(dbInsans($_GET['y']));
Be sure to either include a file with your db variables, like most people including myself do or set them here.
I don't know if those are conventional names, but a lot of people tend to use those, if you don't use the same variable names feel free to alter my code below to match yours. Now for the code to add the name or update the count, place this anywhere under the function code... You can even place them right after each other.
That's all the code you need to add people to the database, but how about view who's been to your site? Well here's the code I came up with... I highly suggest you place this in a password protected directory, or at least in an admin section. A real "friend" doesn't place his friend's ip addresses and screen names for the public eye. ;-) (Remember to either include your admin variables file or include...)
(again)
Feel free to alter the code above into a table or whatever formatting you desire. (You'll need some basic knowledge about echo statements though... not really that hard.) Finally, when you want to create a link in your AIM profile set the link like this... www.yoursite.com/yourfolder/thepage.php?x=%n I hope this helped out some people. -Timo Edited: 2/8/04; now includes date so it will tell when the last time the person visited your page was. Edited: 2/11/04; now works with name formatting to remove spaces and make lowercase; it can now catch when people change their name format. This post has been edited by Timo: Feb 11 2004, 06:49 PM -------------------- |
||||||||||||||
|
|
|||||||||||||||
Feb 1 2004, 09:04 PM
Post
#2
|
|
![]() Professional newbie Group: Admin Posts: 7238 Joined: 8-October 03 From: in the backroom counting up your visitors Member No.: 4 |
astounding tutorial timo!!
Gotta give it a go /added oops i see the quick reply box isn't enabled in the tutorial category, better go enable it -------------------- Get Tough - Take photoshop by the horns - photoshop tutorials
whatcounter.com - free hit counter - quality stats about your website rivalled by nothing else. TinyShortURL - Free URL shortening service myIp.weborum.com - What's my IP ? sms.weborum.com - Free US sms messages for Weborum members |
|
|
|
Feb 1 2004, 09:09 PM
Post
#3
|
|||
|
I'm not drunk! ;D ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1682 Joined: 31-January 04 From: Bentley College Member No.: 7 |
Haha thanks, I think I made this about a year ago when I was first starting out with php. I just, about 10 mins ago, put the tutorial code together and tried to optimize it. I tend to be dyslexic at times though, so give me a holler if it causes an error. I think it'll work well though still. Oh here's a little addition...
It wouldn't be too hard to add a date field to this too, but I never did in my original script and really had no use with knowing when the people came, I just was more into how many times. With the above code open the file with the view people with whichever sorting you want... You could even put the choices at the top of the page and just load like www.yoursite.com/yourfolder/adminscript.php?z=1 1. Shows it from who came first to last, the order they were inserted 2. Shows by ABC names 3. Shows by ZYX names 4. Shows by least visits 5. Shows by most visits 6. Shows by earliest date 7. Shows by latest date Anything else or no variable. Shows who came first to last, like #1 Oh that replaces the last block of code if anyone wants to customize it. Not hard to do on your own, just thought I'd add it if people are lazy. (Like me usually.) -Timo Edited: 2/8/04; Includes the date queries and menubar. This post has been edited by Timo: Feb 8 2004, 10:55 PM -------------------- |
||
|
|
|||
Feb 8 2004, 10:05 PM
Post
#4
|
|
|
I'm not drunk! ;D ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1682 Joined: 31-January 04 From: Bentley College Member No.: 7 |
Two updates... They are in red up above, but here they are again.
Added a date field to the database and allowed it to automatically place the value for you of when the person visited last. Bigger update on my second post with the update to the query. Created a very simple text menu bar and also allowed a date query... You don't need to remember the z values now, it has it so you can just click the link. Oh and I tested both updated scripts and they work well. -Timo Another addition to it.. hah I made some pretty tables to hold the info. This post has been edited by Timo: Feb 8 2004, 10:56 PM -------------------- |
|
|
|
![]() ![]() |
| Lo-Fi Version Euribor Reviews |
Time is now: 9th September 2010 - 08:55 PM |