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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.