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.

My cc_class.php file NO DATA

Highlighted
Member

My cc_class.php file NO DATA

Each time I refer to my cc_class.php in my PHP it returns absolutely nothing.  What am I doing wrong?

3 REPLIES 3
Highlighted
Employee

Re: My cc_class.php file NO DATA

Hey AAATidwater,

 

Are you getting any error messages?  Could you post a snippit of code so we can review what it is you are trying to do with the file?

 

Thanks,

 

Andrew Weber
Associate Product Manager for EventSpot
Highlighted
Member

Re: My cc_class.php file NO DATA

Sorry I should have made those things clear initially.  It was a quick message made in frustration at the end of the day.

 

I have set up the parameters correctly, but every time I try to call the cc_class.php to initiate anything in PHP it renders a blank screen equivalent to no code whatsoever and no error message.  I am trying to use the following code.  Please bear in mind this is not my code and I am trying to work with it in order to make the Edit Contact page appear for my customers:

 

<?php
include_once($v3Path."/includes/classes/ConstantContact/cc_class.php");
$ccOBJ = new ConstantContact();
$is_contact=NULL;
if (!empty($_SESSION['email'])) {
	$contact = $ccOBJ->getSubscribers(urlencode($_SESSION['email']));
	$details = $ccOBJ->getSubscriberDetails(urlencode($_SESSION['email']));
	if (empty($contact['items']) || empty($_SESSION['email'])) {
		$is_contact = false;
		//header('Location: simple_form.php?email='.urlencode($_POST['src_mail']));		
	}
	else {
		$is_contact = true;
		//header('Location: edit_contact.php?email='.urlencode($_POST['src_mail']));		
	}
}
if(!isset($_SESSION['email'])) {
	header("Location: ".$v3linkURL."/portal/Account/Profile");
}
?>

 Any help you can provide would be greatly appreciated.

 

Thanks,

Nikki

 

 

 

 

Highlighted
Employee

Re: My cc_class.php file NO DATA

Hi Nikki,

 

We can work through this step by step. 

 

I noticed the header redirect lines are commented out so that may be one reason why you are receiving a blank page.  Just remove the two // to uncomment.

//header('Location: simple_form.php?email='.urlencode($_POST['src_mail']));

 

//header('Location: edit_contact.php?email='.urlencode($_POST['src_mail']));

 Another reason why you could be getting a blank screen is because this is a production enviroment and in your PHP setting you have selected not to display errors.  This is good so the site looks cleaner for your customers but makes it more difficult to troubleshoot issues with out knowiing where to start.

 

You can turn on errors by adding this to your PHP page:

error_reporting(E_ALL);

 

If uncommenting the header redirects don't work, please let me know what errors you are getting. 

 

Thanks,

 

 

Andrew Weber
Associate Product Manager for EventSpot
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