Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Link hits

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Tiho



Joined: 10 May 2004
Posts: 14
Location: VT

PostPosted: 17.06.2004 23:14    Post subject: Link hits Add user to your forum ignore list Reply with quote

Jel zna neko gdje nac skriptu koja broji "hits" na linkove? Ja sam trazio po puno scripts stranicama i nama bas neki izbor (sve se placaju). hvala !!! Very Happy
Back to top
View user's profile Send private message Visit poster's website
Phiber



Joined: 18 Apr 2004
Posts: 319
Location: Čakovec, Kroejša

PostPosted: 17.06.2004 23:44    Post subject: Add user to your forum ignore list Reply with quote

ako imas mogucnost php-a i mysql-a, evo ti skripta pisana on-the-fly:

u bazu stavi ovo:
Code:

CREATE TABLE `linkovi` (
`id` INT( 5 ) NOT NULL AUTO_INCREMENT ,
`klikova` INT( 10 ) NOT NULL ,
`link` VARCHAR( 200 ) NOT NULL ,
UNIQUE (
`id`
)
);


u index.php stavi ovo:
Code:

<?php
$host="localhost";
$username="username";
$password="password";
$baza="baza";
mysql_connect($host,$username,$password);
mysql_selectdb($baza);

function broj_klikova($id)
{
  $kveri=mysql_query("select klikova from linkovi where id='$id'");
  list($klikova)=mysql_fetch_row($kveri);
  echo $klikova;
}
?>


i sad pises linkove ovako:
Code:

ovo vam je <a href="redirect.php?id=1" target="_blank">link br. jedan(<?php broj_klikova(1); ?> klikova)</a>


u index.php na kraj dodas:
Code:

<?php
mysql_close();
?>


u redirect.php stavis:
Code:

<?php
$host="localhost";
$username="username";
$password="password";
$baza="baza";
mysql_connect($host,$username,$password);
mysql_selectdb($baza);

$id=$_GET['id'];
$kveri=mysql_query("select link,klikova from linkovi where id='$id'");
list($link,$klikova)=mysql_fetch_row($kveri);
$klikova++;
mysql_query("update linkovi set klikova='$klikova' where id='$id'");
mysql_close();
header("Location: $link");
?>


promjeni svaki $host, $username i $password.
linkove stavljas u bazu preko recimo phpmyadmina. (www.phpmyadmin.org)

brojni editi zbog realnih juzernejmova sa lokalnog servera. (kopi pejst Smile

Last edited by Phiber on 18.06.2004 00:31; edited 4 times in total

_________________
- Xatrix Security news portal -- redizajn napravljen, al radim css Smile
- - TIP / Rapid IT : web design & hosting -- za ovog ne, taj je u ladici Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
blackduke
mi3.crew


Joined: 08 Sep 2003
Posts: 2681
Location: Zagreb

PostPosted: 17.06.2004 23:45    Post subject: Add user to your forum ignore list Reply with quote

evo uz phiberovo i lista php countera sa hotscriptsa
http://www.hotscripts.com/PHP/Scripts_and_Programs/Counters/Text_Based/index.html

imas naravno njih koji koriste kao bazu *.txt file pa se ne hebes s bazom
hope that helps
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Phiber



Joined: 18 Apr 2004
Posts: 319
Location: Čakovec, Kroejša

PostPosted: 17.06.2004 23:51    Post subject: Add user to your forum ignore list Reply with quote

evo. skripta radi.
a za TEXT baze.... grrrrrrrrrrrrrrr mrzim TEXT baze. ak nemas pristup bazi, a oces sajt furat u php-u, ubi se. Smile

_________________
- Xatrix Security news portal -- redizajn napravljen, al radim css Smile
- - TIP / Rapid IT : web design & hosting -- za ovog ne, taj je u ladici Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
silence



Joined: 24 Apr 2004
Posts: 890
Location: .....ni na nebu, ni na zemlji.....

PostPosted: 18.06.2004 06:19    Post subject: Add user to your forum ignore list Reply with quote

nemojte me ubit za ovaj komentar, ali meni je 100 puta draža mysql_fetch_assoc (),
pogotovo kad objašnjavam nekom ko zna manje od mene (malo je takvih Wink )

ooops..i još jedna sitnica...

Code:

$id=$_GET['id'];
$kveri=mysql_query("select link,klikova from linkovi where id='$id'");
list($link,$klikova)=mysql_fetch_row($kveri);
$klikova++;
mysql_query("update linkovi set klikova='$klikova' where id='$id'");


ovo je increment?...može i ovako :
Code:

mysql_query ("UPDATE linkovi SET `klikova`=klikova+1 WHERE id='".$_GET['id'].")';



ajd kad sam već spomenuo mysql_fetch_assoc () da objasnim....
imaš : list ($link, $kilikova) = mysql_fetch_row ($kveri);
osobno rađe prebacim sve u jednu varijablu, recimo $podaci putem mysql_fetch_assoc()

$podaci = mysql_fetch_assoc( $kveri);
$podaci['link']
$podaci['klikova']

ne znam, nekako mi je prirodnije ovako Very Happy

_________________
This End-User License is an agreement between Microsoft Corporation (hereafter referred to as "Microsoft") and you, the end-user (hereafter referred to as "our bitch").
Back to top
View user's profile Send private message Visit poster's website
Phiber



Joined: 18 Apr 2004
Posts: 319
Location: Čakovec, Kroejša

PostPosted: 18.06.2004 09:11    Post subject: Add user to your forum ignore list Reply with quote

meni je bolje kad vidim koje varijable sam assoc.
jebes array, u ovom slucaju Smile

_________________
- Xatrix Security news portal -- redizajn napravljen, al radim css Smile
- - TIP / Rapid IT : web design & hosting -- za ovog ne, taj je u ladici Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Tiho



Joined: 10 May 2004
Posts: 14
Location: VT

PostPosted: 18.06.2004 16:35    Post subject: Hvala Add user to your forum ignore list Reply with quote

Hvala!! Very Happy
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group