Hallo zusammen
Gibt es eine möglichkeit, dass man zählen kann, wiefiele male man auf einen link geklikt hat??
Gibt es eine möglichkeit, dass man zählen kann, wiefiele male man auf einen link geklikt hat??
// weiterleitung.php
<html>
<head>
<?php
mysql_connect ($dbserver,$dbuser,$dbpass);
mysql_select_db ($dbname);
$result = mysql_query("SELECT * FROM links WHERE url ='$url' ");
$daten = mysql_fetch_array($result);
$hitsneu=$daten[hits]+1;
$query = "UPDATE links SET hits='$hitsneu' WHERE url ='$url'";
$result = mysql_query($query);
mysql_query($query);
mysql_close();
?>
<?php
if(isset($url)){
echo"<meta http-equiv=\"refresh\" content=\"1; URL=http://$url\">";
} else {
echo"<meta http-equiv=\"refresh\" content=\"1; URL=http://linkspage.php\">";
}
?>
</head>
</html>
mysql_connect ($dbserver,$dbuser,$dbpass);
mysql_select_db ($dbname);
$result = mysql_query("UPDATE links SET hits=hits+1 WHERE url ='$url'");
<html>
<head>
<?php
mysql_connect ('localhost','DBName','DBPasswort');
mysql_select_db ('klickcounter');
$result = mysql_query("Select * from links WHERE id ='$id'");
while ($row = mysql_fetch_object($result)) {
$ergebnis = $row->hits;
$addy = $row->url;
mysql_query("UPDATE `links` SET hits=$ergebnis+1 WHERE id ='$id'");
echo"<meta http-equiv=\"refresh\" content=\"0; URL=$addy\">";
}
mysql_close();
?>
</head>
</html>
CREATE TABLE `klickcounter` (
`id` INT( 255 ) NOT NULL AUTO_INCREMENT ,
`hits` VARCHAR( 255 ) NOT NULL ,
`url` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `id` )
);
<?php
mysql_connect ('localhost','DBName','DBPasswort');
mysql_select_db ('klickcounter');
$result = mysql_query("Select url from links WHERE id ='$id' LIMIT 1");
$row = mysql_fetch_assoc($result)
mysql_query("UPDATE `links` SET hits=hits+1 WHERE id ='$id' LIMIT 1");
header('Location: ' . $row['url'])
?>
Parse error: parse error, unexpected T_STRING in /verzeichnis/htdocs/call.php on line 11
// call.php
<html>
<head>
<?php
mysql_connect ('*.*.*.*',"*****.com","******");
mysql_select_db ('DB1234');
$result = mysql_query("Select linkadresse from shoptable WHERE ID ='$id'' LIMIT 1");
$row = mysql_fetch_assoc($result)
mysql_query("UPDATE `shoptable` SET hits=hits+1 WHERE ID ='$id' LIMIT 1");
header('Location: ' . $row['linkadresse'])
mysql_close();
?>
</head>
</html>
Kommentar