This is a discussion on "Show most visited links" within the PHP Forum section. This forum, and the thread "Show most visited links are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Show most visited links
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Show most visited links
I have a webpage with links which I wish to make a top ten-list of so I need a script that will do the job for me
If anyone have a tip how to do this it would be of great help. Thanks ![]() |
|
|
|
#2
|
||||
|
||||
|
Re: Show most visited links
i think that this would require you to add to a mysql record every time i page is loaded.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#3
|
||||
|
||||
|
Re: Show most visited links
do you know how to create mysql tables?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#4
|
|||
|
|||
|
Re: Show most visited links
Thanks for reply!
I have a database but I don't know how to make a table in it. I only have permission to one database. I found a script called GoLinks but I get stuck when it comes to create a table in my database. GoLinks seems good but I don't need all of the stuff that comes with it Last edited by berraf; Aug 28th, 2007 at 17:20. |
|
#5
|
|||
|
|||
|
Re: Show most visited links
Do you know if your server has phpMyAdmin installed?
That is the easiest way to work with MySQL databases. It does all the work for you otherwise your going to have to learn some SQL, you can learn through some of these sites. http://www.w3schools.com/sql/default.asp http://sqlcourse.com http://www.sql-tutorial.net |
|
#6
|
||||
|
||||
|
Re: Show most visited links
make a database called web (or something) and I can make a quick code for you
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#7
|
|||
|
|||
|
Re: Show most visited links
Quote:
|
|
#8
|
||||
|
||||
|
Re: Show most visited links
alright then,
5 mins.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#9
|
||||
|
||||
|
Re: Show most visited links
save this as createtable.php then run it, if you get errors tell me.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#10
|
|||
|
|||
|
Re: Show most visited links
The script works like a clock! Thanks!
How can I go on from here? |
|
#11
|
||||
|
||||
|
Re: Show most visited links
Okay, I've been up all night.
not slept I'm off to bed, and I'll do the rest for you in a few hours
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#12
|
|||
|
|||
|
Re: Show most visited links
Well I won't actually write the script for you. We encourage learning by yourself here
I can however give you some pointers though I'd have a table with these fields: id|url|hits Then the link on the page would be something like this "outgoing.php?id=1" Then the outgoing.php script would extract the url from the database with the matching id as the one in ?id=x If a match is found you then update hits to add one on. If all go well you then redirect to the url (using header() function) which you have just pulled out of the database. This may not be the best way of doing it but it will work. Hope this will help ya out, Blake |
|
#13
|
||||
|
||||
|
Re: Show most visited links
Quote:
you could just include a script on every page you want ranked, and that script would add one to the table. a lot easier
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#14
|
|||
|
|||
|
Re: Show most visited links
Yeah but what's the script gonna do? hows it gonna know what link you clicked and which one to add a hit onto?
Unless you used AJAX. But that's probably more bother than it's worth lol |
|
#15
|
||||
|
||||
|
Re: Show most visited links
you don't have to know which link you clicked
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#16
|
|||
|
|||
|
Re: Show most visited links
Why not? There's a big list of them on the page.
You'll need to know which url it is in question Did you look at the link they posted lol Last edited by Blake121; Aug 30th, 2007 at 00:34. |
|
#17
|
||||
|
||||
|
Re: Show most visited links
but if you put the script on every page, it will put itself in the database,
using $_SERVER['REQUEST_URI']
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#18
|
|||
|
|||
|
Re: Show most visited links
Well I'm a total newbie so it would take me to much time to learn to do this script so it would be great if I could get that help
|