Jump to content

download/link counter


Readme

Recommended Posts

see if that works mate.....

 

<?php

//database connection.

$x=$_POST['x'];

$x="GO TO GOOGLE";

echo "<a href='http://google.com'>$x</a>";

$sql="UPDATE link_counter set count=count+1 WHERE x='$x'";
$res=mysql_query($sql)or die(mysql_error());
?>

 

 

database name: link_counter

 

id int not null auto_increment primary_key

count int not null deafult 0

x text not null default GO TO GOOGLE

 

 

Link to comment
https://forums.phpfreaks.com/topic/92916-downloadlink-counter/#findComment-476004
Share on other sites

hmm

Connected to MySQL

GO TO GOOGLENo database selected

 

<?php

$username = "xxx";
$password = "xxx";
$hostname = "xxx"; 

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
  or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";


$x=$_POST['x'];

$x="GO TO GOOGLE";

echo "<a href='http://google.com'>$x</a>";

$sql="UPDATE link_counter set count=count+1 WHERE x='$x'";
$res=mysql_query($sql)or die(mysql_error());
?>

 

Something wrong

Link to comment
https://forums.phpfreaks.com/topic/92916-downloadlink-counter/#findComment-476132
Share on other sites

horrible  :D

 

GO TO GOOGLE Table 'link_counter.link_counter' doesn't exist

 

<?php

$dbhost = "localhost"; 
$dbuser = "root"; 
$dbpass = ""; 
$dbname = "link_counter"; 

//connect 
$db = mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db("$dbname",$db); 


$x=$_POST['x'];

$x="GO TO GOOGLE";

echo "<a href='http://google.com'>$x</a>";

$sql="UPDATE link_counter set count=count+1 WHERE x='$x'";
$res=mysql_query($sql)or die(mysql_error());
?>

Link to comment
https://forums.phpfreaks.com/topic/92916-downloadlink-counter/#findComment-476171
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.