帮助点击跟踪器PHP代码 [英] help with click tracker php code

查看:62
本文介绍了帮助点击跟踪器PHP代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点击跟踪PHP代码在我的网站上显示:





i have this click tracking php code for displaying on my site:


< ?php>   if (!file_exists("config.php")) {
  header("Location: installer");
  }

  require_once("config.php");

  //Connect to database
  @$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
  if (!$con) {
  die("Error: Could not connect to database (" . mysql_error() . "). Check your database settings are correct.");
  }

  //Check database exists
  $does_db_exist = mysql_select_db(DB_NAME, $con);
  if (!$does_db_exist) {
  die("Error: Database does not exist (" . mysql_error() . "). Check your database  settings are correct.");
  }

  if (isset($_GET["id"])) {
  $id = mysql_real_escape_string($_GET["id"]);
  } else {
  die("Error: ID cannot be blank.");
  }

  //If ID exists, show count or else die
  $showinfo = mysql_query("SELECT count FROM Data WHERE id = \"$id\"");
  $showresult = mysql_fetch_assoc($showinfo);
  if ($showresult != 0) {
  echo $showresult["count"];
  } else {
  die("Error: ID does not exist.");
  }

  mysql_close($con);

 ?>





i想要显示使用此给定代码下载文件的编号,方法是在我的html中插入此代码,以便显示下载的时间,但不起作用:





i want to show the number the file was downloaded with this given code,by inserting this code in my html so it displays how mnay times downloaded, but its not working:

< ?php> $_GET["id"] = "download1";
  include("indication/display.php");
  ?>









我把那个代码放在我的html中但它没有显示数字



任何想法为什么?





I placed that code in my html but it doesnt show the number

any ideas why??

推荐答案

con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if (!
con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if (!


con){
die( 错误:无法连接到数据库( .mysql_error()。 < span class =code-string>)。检查数据库设置是否正确。);
}

// 检查数据库是否存在
con) { die("Error: Could not connect to database (" . mysql_error() . "). Check your database settings are correct."); } //Check database exists


does_db_exist = mysql_select_db(DB_NAME,
does_db_exist = mysql_select_db(DB_NAME,


这篇关于帮助点击跟踪器PHP代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆