close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

download counter

Thread began 5/30/2012 5:50 pm by rayne202093 | Last modified 8/08/2012 5:09 pm by Jason Byrnes | 2657 views | 16 replies |

rayne202093

download counter

I want to use digital file pro to handle the downloading of one file to customers who log in to see the link. I can do all the log in code and get the customer to the download page, but had a question about how the download counter works.

Does the download counter (update download count in database) keep count of how many times an individual person (identified through a session variable) downloaded the file or is it just a global count of how many times the file has been downloaded?

If it doesn't keep a count of how many times a single person downloads the file, is it possible to write the session variable of the person into the download counter table every time he downloads the file?

Thanks.
--rayne

Sign in to reply to this post

Jason ByrnesWebAssist

it can do either, keep a global count, or count for a specific person, it all depends on how you set the Key Column section.


the Key Column section sets how the download count will determine what to update.


to update a download count column in the users table, set the key column to the User ID and for the value, use the Users session variable.

Sign in to reply to this post

rayne202093

I have setup a form that a user fills out with a serial number and then submits. His serial number is checked to make sure it has not expired and if it has not a "download (submit) button" is displayed. The user then clicks the download button and the file is downloaded successfully. All that works great. However, no entry is written in the download counter table.

In the "configure file download settings" dialog box, I set up the download counter options as:
checked: update download count in database
connection: the correct connection
table: the table name to hold the count information (which the dialog box found)
key column: keycolval field
key column value: <?php echo $row_Recordset1['serialno']; ?>
count column: countcol field

The table exists, the fields exist, the file is downloaded successfully, but no record is entered into the table when the download button is clicked. No error is generated. Did I miss a step in setting the download counter up?

Are there any online instructions beside those found here: digital_file_pro.html?

Thanks.
--rayne

Sign in to reply to this post

Jason ByrnesWebAssist

  no entry is written in the download counter table.  



the download counter does not create a new entry in the database, it updates an entry in the database.


  In the "configure file download settings" dialog box, I set up the download counter options as:
checked: update download count in database
connection: the correct connection
table: the table name to hold the count information (which the dialog box found)
key column: keycolval field
key column value: <?php echo $row_Recordset1['serialno']; ?>
count column: countcol field  



since you are using a recordset value for the key column value, make sure the code for the recordset is before the code for the download.

also, if the recordset has any filters, those will need to be included in the form submit.

If you need further details, send a copy of your page in a zip archive so I can see the entire page code.

Sign in to reply to this post

rayne202093

If the download counter doesn`t create an entry, how does it keep track of new people that download the file? It doesn`t write the initial entry of a download and then increment it if that person downloads the file again?

I have attached a copy of the page.

Thanks for the help.
--rayne

Attached Files
download.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the download count column of your table should have a default value of 0, so that whenever a new record is initially created, the count is set to 0.

Sign in to reply to this post

rayne202093

I am sorry to be dense, but I need to keep a count of how many times a person downloads a file. So how does the download counter do that if it doesn't write the record in the table the first time someone downloads the file?
--rayne

Sign in to reply to this post

Jason ByrnesWebAssist

in the database, you need to set the download count column to use a numeric data type, and you need to set the download count column to have a default value of 0.

when the user downloads the file, the download behavior will be able to increment the 0 value to 1 and so on. But only if there is a default value of 0. If there is no value, the increment cannot happen because it will be set to NULL, math cannot be performed on a NULL Value.

Sign in to reply to this post

rayne202093

OK, so everyone that might ever download the file has to already be in the table with their count set to zero for the download counter to work? The script only looks up the record to increment it?
--rayne

Sign in to reply to this post

Jason ByrnesWebAssist

yes, that is correct.

Sign in to reply to this post
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...