Solved

PDF file download ONLY when user provides appropriate info.

Posted on 2006-06-22
9
165 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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
 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

791 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