Jump to content

Click Counter


miligraf

Recommended Posts

Hello, i have a click counter that works with a link like this: [b]http://www.yourdomain.com/tutorial.php?id=1[/b] But when i click the link it takes me to that URL and not to the one saved in the SQL table, so i guess its the [b]tutorial.php[/b]. Ive been trying to make it work but i cant :(

tutorial.php

[code]<?
include ('conbd.php');

$query = mysql_query ("SELECT * FROM tutoriales WHERE id='$id'");

while ($row = mysql_fetch_row($query))
{

$id = $row[0];
$enlace = $row[5];

header('Location: '.$enlace);

}

mysql_query ("UPDATE tutoriales SET clics = clics + 1 WHERE id='$id'");
?>[/code]

Thanks for your help!
Link to comment
https://forums.phpfreaks.com/topic/8675-click-counter/
Share on other sites

Doesnt work either...ive checked the other php where you click the link but it works fine, its this [b]tutorial.php[/b] that isnt working, it doesnt add the click or redirects you to the URL stored in the database. I dunno what happened, it was working fine before but now it doesnt.

Edit: i already figured out the problem, thx for your help!
Link to comment
https://forums.phpfreaks.com/topic/8675-click-counter/#findComment-32238
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.