Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:58:36+00:00 2026-05-22T23:58:36+00:00

I made a PHP page that looks up Constant Contact e-mail addresses in a

  • 0

I made a PHP page that looks up Constant Contact e-mail addresses in a database and returns a table listing their name, e-mail address, and mailing list they are in. You enter the addresses here: Contact Lookup Tool along with your Constant Contact user name and password.

For some reason, only the last row of the results page has a list of mailing lists. The other ones have the word “Array,” which I stripped out, so now those rows are blank. Here is a screen shot of what I mean:

http://www.advantage-computer.com/images/ScreenCap.png

They’re all in a list, though. Here’s the code for search.php. The form submits to that file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <title>List of Contacts</title>
        <style type="text/css">
            .hdr
            {
                margin-bottom: 0px;
                padding-bottom: 0px;
            }
        </style>
    </head>
    <body>
        <table width="75%">
            <tr>
                <td class="hdr">Name</td>
                <td class="hdr">E-mail address</td>
                <td class="hdr">List(s)</td>
            </tr>
            <tr>
                <td colspan="3">
                    <hr style="padding:0; margin:0">
                </td>
            </tr>
            <?PHP
                require_once('./class.cc.php');

                /*VARIABLES*/
                $cc = new cc($_POST['userName'], $_POST['password']);
                if($cc)
                {
                    $strEmails = $_REQUEST['emails'];
                    $aryEmails = explode("\n", $strEmails);

                    $page = (isset($_GET['page'])) ? $_GET['page'] : 'lists';
                    $lists = $cc->get_lists($page);

                    /*METHODS*/
                    foreach ($aryEmails as $email)
                    {       
                        if($lists)
                        {
                            foreach($lists as $k => $v)
                            {
                                $list = $v['Name'];
                                $page = (isset($_GET['page'])) ? $_GET['page'] : 'members';
                                $members = $cc->get_list_members($v['id'], $page);

                                if($members)
                                {
                                    foreach($members as $k => $v)
                                    {
                                        if($v['EmailAddress'] == $email)
                                        {
                                            $strLists .= $list . ", ";
                                        }
                                    }
                                }
                            }
                        }

                        $strLists = str_replace("Array", "", $strLists);
                        $strLists = substr($strLists, 0, -2);

                        $contact = $cc->query_contacts(trim($email));

                        if($contact)
                        {
                            $strName = $contact['Name'];
                            if(is_array($strName))
                            {
                                $strName = "";
                            }

                            echo
                            (
                                "<tr><td>".$strName."</td>".
                                "<td>".$contact['EmailAddress']."</td>".
                                "<td>".$strLists."</td></tr>"
                            );
                        }

                        else
                        {
                            echo("<tr><td colspan='3'>Could not find {$email}.</td></tr>");
                        }
                    }
                }

                else
                {
                    echo "Invalid user name or password";
                }
            ?>
        </table>
    </body>
</html>

Here is the class.cc file: http://advantage-computer.com/tools/class.cc.txt

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:58:37+00:00Added an answer on May 22, 2026 at 11:58 pm

    Thanks everyone for the replies. My brother found the problem. He changed

    foreach ($aryEmails as $email){
        ...
    }
    

    to

    foreach ($aryEmails as $tmpEmail){ 
        $email = rtrim($tmpEmail);
        ...
    }
    

    It appears that it only matched the last line in the text area because there were still carriage returns in the e-mail array left over from the text area. He added rtrim to remove them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had made some questions regarding PHP-GTK (there are only 4 php-gtk tagged questions
I have a website built in PHP 4 with a framework made by hand
So I'm going to be working on a home made blog system in PHP
Made solution change: I am trying to display a html table of data.. In
I made a class that derives from Component: public class MyComponent: System.ComponentModel.Component { }
I made a code that translate strings to match each word from the array
I have a toolbarMenu.php that uses css in a css directory (css) from the
I have a website that is fairly database intensive, so I'm trying to cut
I made a view to abstract columns of different tables and pre-filter and pre-sort
I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.