Solved

PDF file download ONLY when user provides appropriate info.

Posted on 2006-06-22
9
162 Views
Last Modified: 2013-12-24
Hey everyone

I have about 5 pdf files that we want users to be able to download. We would like to collect some contact information from them before they download the file.

Here is what I have been thinking: A user clicks on the "Take a Test" icon on our home page. The user then selects which test he/she wants to take. But before download, they are taken to a form where they provide us with some information. Only after all the required info is submitted should the user be able to actually download the pdf file or test.

Is there a way to do this without a database? Can someone help me out?

Thanks!!

IShiva
0
Comment
Question by:IShiva
  • 3
  • 3
  • 2
9 Comments
 
LVL 9

Expert Comment

by:73Spyder
ID: 16959450
You could use cfmail and have the form information emailed to you instead of storing it in a database.

You would still be able to use some form of validation to make sure that they give you the information you want, before taking them to the the page.  
Part of the form would be the list of test, you would need to hardcode in the values so that on the form process / email page you know what link to provide the user to download.
0
 
LVL 9

Expert Comment

by:73Spyder
ID: 16959469
oops.  hit submit before I inteneded to

With only 5 pdf's this would not be a hard task to manage.

If you find that you are constantly changing the tests and adding / removing items from the pages, you will find that you may want to upgrade to a data driven solution instead.
0
 

Author Comment

by:IShiva
ID: 16959523
73Spyder,

I see where youre going with it. Could you start me out with some code?

So I will really only have 2 pages? The form page where the user fills out their info and selects lets say a radio button for the test they want to take. Then following submission, based on the form value for the certain test, they are then taken to a page to click the 'download your test now' link?

Im not too much of a coder but if you start me out, I can usually figure the rest out........usually. :)

Thanks!!
0
 
LVL 9

Expert Comment

by:73Spyder
ID: 16959584
I can,  it will take me a bit to get some time to put something together.  Check back later today
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:IShiva
ID: 16959821
Wonderful.....Thanks!!!
0
 
LVL 13

Accepted Solution

by:
usachrisk1983 earned 500 total points
ID: 17022275
Your page would look like this:

<cfif not isDefined('form.testName') or trim(form.testName) is ''>
  <cfform name="frmCollectInformation" method="post">
   <cfinput type="radio" name="testName" value="test_1"> Test 1<br>
   <cfinput type="radio" name="testName" value="test_2"> Test 2<br>
   <cfinput type="radio" name="testName" value="test_3"> Test 3<br>
   <br>
   Please Enter Your Name: <cfinput type="text" name="clientName" value="">
 </cfform>

<cfelse>

  <!--- You could put some business logic here, such as only continue if they have a name entered --->

  <cfset form.testName = lcase(form.testName)>

  <cfif form.testName is 'test_1'> <!--- Redirect User to File, or Mail it to them, whatever ---> </cfif>
  <cfif form.testName is 'test_2'> <!--- Redirect User to File, or Mail it to them, whatever ---> </cfif>
  <cfif form.testName is 'test_3'> <!--- Redirect User to File, or Mail it to them, whatever ---> </cfif>

  <!--- You could do something here to store their name or whatever your collect --->

</cfif>
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17255761
IShiva, were you able to test my solution?
0
 

Author Comment

by:IShiva
ID: 17263122
Yes, thanks usachrisk1983! Sorry I didnt respond sooner as I forgot. (Seems like I do that a lot here!! haha)

I appreciate the help!

IShiva
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now