...

View Full Version : need to add questionnaire with paypal purchase



sixrfan
10-19-2009, 06:16 PM
as you can see here i added a bunch of paypal links to my site so people can purchase different levels of membership: http://www.goldcoastchamber.com/wordpress/?page_id=48

however, when someone applies for membership, i also need to require that they fill out a short questionnaire about their business.

how do i work the questionnaire into the flow? should it come before or after the paypal purchase? whats the best way to set it up? thanks!

Rowsdower!
10-19-2009, 08:19 PM
as you can see here i added a bunch of paypal links to my site so people can purchase different levels of membership: http://www.goldcoastchamber.com/wordpress/?page_id=48

however, when someone applies for membership, i also need to require that they fill out a short questionnaire about their business.

how do i work the questionnaire into the flow? should it come before or after the paypal purchase? whats the best way to set it up? thanks!

Instead of linking directly to the Paypal site I would direct them to the information form (with server-side script to check the form for errors and make sure that required fields are filled in with valid information). And don't use the Paypal buttons for this since there isn't really a cart for them to use.

When they submit the form the server-side script should validate the information and if everything is OK it then stores the info in your DB (with payment status as "pending" or similar) and directs them to the Paypal page. Once paypal sends them back to your site after they have successfully paid you your script should update their new payment confirmation status in your DB and that's that.

If you try to get them to fill out the form afterward you might end up with paying customers angrily wondering why their account isn't active because they skipped the form (or overlooked it). I think it would be better for customer service to have them do the form first.

sixrfan
10-19-2009, 08:27 PM
thanks Rowsdower. i'm fairly skilled in the ways of HTML and CSS but not at all when it comes to scripts. is there a server-side script with validation process for dummies? or something along those lines? or is it much more complicated and better to hand off this piece of the process to an expert?

Rowsdower!
10-19-2009, 09:53 PM
Your web host most likely supports the use of PHP (a server-side script language). Your database is most likely MySQL. Both of these are pretty common and learning to use them is not much more complex than javascript.

If you don't know PHP you could probably pick up enough to do this on your own within a few weeks. I always tend to encourage people to do it for themselves.

Form validation is usually a pretty custom-tailored thing since data types and needs are as varied as can be. You can find sample scripts and some ideas online but I wouldn't expect to walk face-first into a ready-made script that does just exactly what you need. You'll almost certainly need to get your hands dirty for this, even on the user's end (javascript validation) and especially on the server-side.

If you don't have the time or desire to learn how to do this validation then I'm sure posting your requirements (and a link to your information form, if available) in the paid work forum would produce some results. Depending on how complicated the form is you could be looking at anywhere from $80-$300 to get a professional for this kind of job.

Now if you do want to program this yourself I would start off in this order:


Step 1: Create the form (this might already be done based on your question). (Simple)
Step 2: Create javascript validation for the form to catch easy errors BEFORE sending the form data to the server. This cuts down on load time for the user and cuts down on server resources and bandwidth for you. Both are a plus. (Simple)
Step 3: Create server-side validation to catch any errors that the javascript missed (particularly incase javascript is disabled on the user's browser settings). The first part should mirror the javascript validation and is used as a fallback incase the javascript fails, is blocked by user settings, or is purposefully evaded by unsavory people trying to do mean things to your site. The second part of the validation is - VERY IMPORTANTLY - to prevent hacking attempts via PHP or MySQL commands being passed as form data. So where the javascript might only check to make sure that the right number of characters are inserted in the phone number section or to make sure that an e-mail field is not blank the server-side script actually needs to check the content of all strings (even optional ones) for any malicious code. There are a few ways to do this - consult google for this part. Then if invalid or missing data exists your script should return the user to the form page with an error message to try again because of reasons blah blah blah "a," "b," and/or "c." You can set the script to re-populate the form with all of the information that the user entered previously to save on frustration. (Somewhat complex)
Step 4: Create server-side script to process the validated/sanitized data, store it in your database, and then direct the user to Paypal. (Pretty simple)
Step 5: Create a server-side script to add confirmed payment status to your new user's database entry once returned from Paypal with a successful payment. (Most likely pretty simple though I have never personally integrated a Paypal shopping cart - there may be a few bumps on that road but probably nothing too serious)


I have added general "difficulty" ratings at the end of each step. These represent my idea of how difficult that particular step is to code - not necessarily how much working time it takes to do it. For example, you already know enough HTML to make a form. It's pretty simple but coding it can take quite a while if you have a lot of <select> items, etc. etc.

Anyway, that's roughly what I would say you need from a to z on this project. If you decide to tackle it yourself then the PHP and javascript forums here will be very useful.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum