Creating an opt-in form that also redirects to a landing page


Creating an opt-in form that also redirects to a landing page

I'm designing a website for my client, and he has several "teaser" videos on the home page. When the end user wants to see the full version of these videos, he/she will be required to enter a name and email address. This info not only uploads to the constant contact database, but it needs to simultaneously redirect the end user to the landing page on which the full length video resides. How the heck do I do this? 


Hey Chris,


You have many options to do something like this.  If I were coding the site I would use the following logic:\


Search for contact (GET)
If(Contact != exist)
Create new contact (POST)
Programming Redirect on success 
Else IF (Contact == exist)
Get Contact (GET)
Add new list to Contacts XML
Update Contact (PUT)
Programming Redirect on success 
No valid data

 As far as the response redirect you can use javascript to change the page.  You can read about how to do this here.


Please let me know if this helps.

Ryan Davis
Quality Engineer


  The javascript link does not work. I also need to do this on my company web site but am at a bit of a loss. 

A simpler solution would be to send the informaiton to a server side page, like a .php or .aspx page.  This page would be able to send the information to Constant Contact and do any other processing you need done.  Once done, it can simply do a redirect to another page containing the full video using whatever server side development language you picked. 


It certainly is possible to do using XmlHttpResponse feature of JavaScript as well.  You could call a server script to do the action, return the response (success/fail) and have client side JavaScript redirect or post a response based on the success/fail message.  This is slightly more complicated as you have to create a valid response for the JavaScript to handle and have all the error handling done client side but could be a more responsive option. 


Hope this helps.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page