The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

CCSFG updated

Highlighted
Occasional Participant

CCSFG updated

Hi I need help!

 

I had problems with the public version of CCSFG 0.0.6 in which it did not allow existing emails to be added to the new mailing list that I have created. This problem was fixed with the updated version.

 

However, now I'm encountering a new problem. Now with the updated version, no matter what text I input in to my registration form, the system will always show the success message. My registration form is simple, I only need users to input their email address only. I tried entering a duplicate email address (email is already on the list) and I tried entering random texts (not email address) and system will always return success message.

 

Please help, I did not make any changes to the updated CCSFG 0.0.6 files.

 

Tags (2)
6 REPLIES 6
Highlighted
Employee

Re: CCSFG updated

Hey Pricilla,

 

The CCSFG doesn't do any validation as it just spits out the HTML and gets the information to store into a variable.  Then it processes the information and tries to do a POST or PUT to the account which will return an error or success based on the cURL status.  if cURL throws an exception, it would be caught and I believe there is an if statement that checks to see if there is a 401, 403, 404 or 500 error and it will display the appropriate exception message.  If it sees a 201 it will display success.  Validation is best served on the client side using javascript but you can also check it via the server side by adding to the appropriate code. 

 

If you want to post a link and let me know how you are breaking the form I would be more than happy to take a look at it and see if it is something we can fix.

Ryan Davis
Quality Engineer
Highlighted
Occasional Participant

Re: CCSFG updated

Hi Ryan,

 

Thank you for your reply.

 

Yes, there is an if statement under /CCSFG_0.0.6_addUpdate/signup/index.php. However, I found that I could enter anything into the text box and it will still display the Success URL.

$return_code = $ccContactOBJ->addOrUpdate($postFields);
		
		if($postFields['request_type'] == 'ajax'){ $postFields["success_url"]=''; $postFields["failure_url"]=''; }
		
		if ($return_code==201 || 204) {
			$error = false;
			if($postFields["success_url"]){	header('Location:'.$postFields["success_url"]); }
			else { echo '<div id="code" title="201"></div><h3>Thank you!</h3><p>Your interest preferences have been successfully recorded.</p>'; }
		} else if ($return_code==409) {
			$error = true;
			if($postFields["failure_url"]){	header('Location:'.$postFields["failure_url"]); }
			else { echo '<div id="code" title="409"></div><h3>We\'re Sorry!</h3><p>It appears that you are already a subscriber of our mailing list.</p>'; }
		} else {
			$error = true;
			if($postFields["failure_url"]){	header('Location:'.$postFields["failure_url"]); }
			else { echo '<div id="code" title="'.$return_code.'"></div><h3>We\'re Sorry!</h3><p>It appears that you were not added to our mailing list. 
			This may be due to one or more of the following reasons:
			<ol>
				<li>You have misspelled your email address</li>
				<li>You did not choose a list to subscribe to</li>
				<li>The system may be busy. Please try again later</li>
			</ol> 

As for my form, I'm basically using the html code that was provided by the constant contact signup form generator:

 

 

<form id="ccsfg" name="ccsfg" method="post" action="/wp-content/themes/twentyten/CCSFG_0.0.6_addUpdate/signup/index.php">

<h4>Registration Form</h4><p>To join our mailing list, please complete the information below and click 'Join My Mailing List'.</p>

<!-- ########## Email Address ########## -->
<label for="EmailAddress">Email Address</label>
<input type="text" name="EmailAddress" value="" id="EmailAddress" /><br />

<!-- ########## Contact Lists ########## -->
<input type="hidden"  checked="checked"  value="asiantalks" name="Lists[]" id="list_asiantalks" />

<input type="submit" name="signup" id="signup" value="Join My Mailing List" />

</form>		

 

 

 

Highlighted
Occasional Participant

Re: CCSFG updated

My only concern basically is just the ERROR MESSAGE. I want the correct error message to be displayed if the user's subscription did not go through. I don't want them to be deceived by the Success Message.

Highlighted
Employee

Re: CCSFG updated

Hey Pricilla,

 

In order to help you I will need to see a link to the page that is getting this error no matter the input.  Also, if you could supply me with the HTML that is given by our CCSFG so i can see what is going on there.   If you would like you can send it to me in an email via the communication we have had there or PM me it here.

Ryan Davis
Quality Engineer
Highlighted
Occasional Participant

Re: CCSFG updated

Hi Ryan,

 

I already supplied you with the HTML. Please check my previous message.

 

<form id="ccsfg" name="ccsfg" method="post" action="/wp-content/themes/twentyten/CCSFG_0.0.6_addUpdate/signup/index.php">

<h4>Registration Form</h4><p>To join our mailing list, please complete the information below and click 'Join My Mailing List'.</p>

<!-- ########## Email Address ########## -->
<label for="EmailAddress">Email Address</label>
<input type="text" name="EmailAddress" value="" id="EmailAddress" /><br />

<!-- ########## Contact Lists ########## -->
<input type="hidden"  checked="checked"  value="asiantalks" name="Lists[]" id="list_asiantalks" />

<input type="submit" name="signup" id="signup" value="Join My Mailing List" />
 

However, I found that the problem was with cc_class.php

Once I eliminated return code 204 from the following expression: ($return_code==201 || 204) and change it to ($return_code==201) I was able to get the error message back.

 

I also found out that that return code: 400 is for invalid email addresses and adjusted the code accordingly.

 

As for the form, here is the link: http://www.asiantalks.com/form.html

 

Please let me know if you're able to provide a better solution.

 

Thanks,
Pricilla 

 


Highlighted
Employee

Re: CCSFG updated

Hey Pricilla,

 

I am going to do some further testing and once I get it to replicate I will make the appropriate changes to our appliation. 

Ryan Davis
Quality Engineer
Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured