close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

download counter And extra info question

Thread begun 5/07/2009 8:21 am by Paul | Last modified 4/13/2010 8:47 am by Jason Byrnes | 7735 views | 17 replies |

PaulBeta Tester

download counter And extra info question

Hi, I hope I've managed to provide enough info/context around my question.

I'd like to insert extra information as well as the download count, in a table. My objective is to capture the download history of logged in users.

The MySQL table is setup with the fields "idx, user_id, filename, date, file_count". (my additional information requirement)

However, the DFP wizards default behaviour appears to only insert the download count value into a specified table - no options to insert addiional info.

Does anyone know how to add the additional information?
Unless i've overlooked something, the solution recipe does not provide anything I can use.

Any help appreciated. Thaks, Paul.

Sign in to reply to this post

Ray BorduinWebAssist

If you use DataAssist to do the insert you should be able to insert into whatever columns you want to. The DFP wizard will only help upload and download the files you still need DataAssist to manipulate the database.

Sign in to reply to this post
Did this help? Tips are appreciated...

Heckie

I've set up my download counter and it works great. The only problem I have is that I need to refresh the page to see the updated count.

How do I get the form to refresh the page with the updated count value?

At the moment I have this (orderdetails.php it the page with the download button):

<form action="orderdetails.php?ID=<?php echo $row_WADAmusic['DetailOrderID']; ?>" method="post" name="downloadform" id="downloadform">

Sign in to reply to this post

Ray BorduinWebAssist

Make sure your update code is above your recordset.

Sign in to reply to this post
Did this help? Tips are appreciated...

Heckie

Not sure what you mean by update code? Can you give me an example?

At the moment the form containing the download button just posts with no action:

<form method="post" name="downloadform" id="downloadform">
<input name="download" type="image" id="download" value="Download" src="../images/design/download2.gif" alt="Download" />
</form>

Sign in to reply to this post

Ray BorduinWebAssist

I am referring to the code above the <html>. What does that look like?

Sign in to reply to this post
Did this help? Tips are appreciated...

Heckie

Here is the complete php section of my orderdetails pae:

<?php
//WA eCart Include
require_once("../WA_eCart/HeckieCart_PHP.php");
?>
<?php require_once('../Connections/connHeckie.php'); ?>
<?php
$HeckieCart->GetContent();
?>
<?php require_once("../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
?>
<?php
$maxRows_WADAorderdetails = 1000;
$pageNum_WADAorderdetails = 0;
if (isset($_GET['pageNum_WADAorderdetails'])) {
$pageNum_WADAorderdetails = $_GET['pageNum_WADAorderdetails'];
}
$startRow_WADAorderdetails = $pageNum_WADAorderdetails * $maxRows_WADAorderdetails;

$WADAID_WADAorderdetails = "-1";
if (isset($_GET['ID'])) {
$WADAID_WADAorderdetails = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);
}
mysql_select_db($database_connHeckie, $connHeckie);
$query_WADAorderdetails = sprintf("SELECT * FROM orderdetails WHERE DetailOrderID = %s ORDER BY DetailItemName ASC", GetSQLValueString($WADAID_WADAorderdetails, "int"));
$query_limit_WADAorderdetails = sprintf("%s LIMIT %d, %d", $query_WADAorderdetails, $startRow_WADAorderdetails, $maxRows_WADAorderdetails);
$WADAorderdetails = mysql_query($query_limit_WADAorderdetails, $connHeckie) or die(mysql_error());
$row_WADAorderdetails = mysql_fetch_assoc($WADAorderdetails);

if (isset($_GET['totalRows_WADAorderdetails'])) {
$totalRows_WADAorderdetails = $_GET['totalRows_WADAorderdetails'];
} else {
$all_WADAorderdetails = mysql_query($query_WADAorderdetails);
$totalRows_WADAorderdetails = mysql_num_rows($all_WADAorderdetails);
}
$totalPages_WADAorderdetails = ceil($totalRows_WADAorderdetails/$maxRows_WADAorderdetails)-1;

$colname_rsOrder = "-1";
if (isset($_GET['ID'])) {
$colname_rsOrder = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);
}
mysql_select_db($database_connHeckie, $connHeckie);
$query_rsOrder = sprintf("SELECT *, DATE_FORMAT(OrderDate, '%%W %%D %%M %%Y %%r') as OrderDate FROM orders WHERE OrderID = %s", GetSQLValueString($colname_rsOrder, "int"));
$rsOrder = mysql_query($query_rsOrder, $connHeckie) or die(mysql_error());
$row_rsOrder = mysql_fetch_assoc($rsOrder);
$totalRows_rsOrder = mysql_num_rows($rsOrder);

$colname_rsDownloadFile = "-1";
if (isset($_POST['fileID'])) {
$colname_rsDownloadFile = (get_magic_quotes_gpc()) ? $_POST['fileID'] : addslashes($_POST['fileID']);
}
mysql_select_db($database_connHeckie, $connHeckie);
$query_rsDownloadFile = sprintf("SELECT * FROM orderdetails WHERE DetailsID = %s", GetSQLValueString($colname_rsDownloadFile, "int"));
$rsDownloadFile = mysql_query($query_rsDownloadFile, $connHeckie) or die(mysql_error());
$row_rsDownloadFile = mysql_fetch_assoc($rsDownloadFile);
$totalRows_rsDownloadFile = mysql_num_rows($rsDownloadFile);?>
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_DownloadFile("WA_DownloadResult1", "../downloads/", "".$row_rsDownloadFile['DetailDownloadFile'] ."", "[FileName]", 1, $database_connHeckie, $connHeckie, "orderdetails", "DetailsID", "".$row_rsDownloadFile['DetailsID'] ."", "DetailDownload");
}
?>
<?php
$queryString_WADAorderdetails = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_WADAorderdetails") == false &&
stristr($param, "totalRows_WADAorderdetails") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_WADAorderdetails = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_WADAorderdetails = sprintf("&totalRows_WADAorderdetails=%d%s", $totalRows_WADAorderdetails, $queryString_WADAorderdetails);
?>
<?php
// WA eCart Redirect
if ($HeckieCart->redirStr != "") {
header("Location: ".$HeckieCart->redirStr);
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

Where is the download counter incremented? I thought I would see some sort of update statement on the page?

How do you display the download count?

Sign in to reply to this post
Did this help? Tips are appreciated...

Heckie

I have basically just placed a bit of dynamic text followed by / 5 (<?php echo $row_WADAorderdetails['DetailDownload']; ?> / 5)

Sign in to reply to this post

Ray BorduinWebAssist

When do you increment DetailDownload?

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...