Jump to content

help with this php code for displaying


jfiler20

Recommended Posts

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 want to show the number the file was downloaded with this given code, but its not working:

 

 

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

 

 

 
I placed that code in my html but it doesnt show the number
 
any ideas why??
Link to comment
https://forums.phpfreaks.com/topic/276624-help-with-this-php-code-for-displaying/
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.