what does Parse error: parse error, unexpected T_CLASS  mean?

Posted on 2006-05-30
Last Modified: 2009-07-29
what does Parse error: parse error, unexpected T_CLASS  mean?

I'm trying something thats a bit new to me.......

I'm sending an email......can any1 give me any hints as to what this may be relating too?

sorry its a bit vague....if u need more info just ask and i can explain a bit.

Question by:scm0sml
    LVL 33

    Expert Comment

    typically, you're missing something on the line above, like a closing ) or a ; or something.  Post the 5 lines above the line reported in the error message, and the line itself.

    Author Comment

    I'm still putting it together so excuse the code.....

    <?php include ("../includes/classes/TellAFriend.php");
    import_request_variables('p', 'p_');

          $friend = new TellAFriend();
          $friend->Name = $p_name1;
          $friend->Email = $p_email1;      

    The function SendEmail consists of:
    function SendEmail()
                $mailTo = "$this->Email";
                $mailSubject = "UK Caravan Finder - Invites You.";                  
                $Header = "MIME-Version: 1.0\r\n";
                $Header .= "Content-type: text/html; charset=iso-8859-1\r\n";
                $Header .= "From:";                        
                $output = "Your friend thought you'd be interested in the new craze if the caravn world!!<BR><BR>";            
                $output = nl2br($output);
                (mail($mailTo, $mailSubject, stripslashes($output), $Header));
    LVL 33

    Accepted Solution

    Without the whole error text, I can't tell for sure, but I'd guess the problem is really in one of those include files, classes/TellAFriend.php or classes/DatabaseHandler.php.

    Author Comment

    the error message is:
    Parse error: parse error, unexpected T_CLASS in /data01/ukcarfin/public_html/includes/classes/DatabaseHandler.php on line 2

    but I use the DatabaseHandler class a lot and and have no probs with it so I dont think thats the prob..........


    Author Comment

    there were spaces somewhere at the beginning or end of the include files..........

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now