Home > Syntax Error > Parse Error Unexpected T_variable Expecting T_old_function

Parse Error Unexpected T_variable Expecting T_old_function

Contents

Why isn't tungsten used in supersonic aircraft? You have to put that line inside a function or the constructor but you can not place it where you have now. For example $var1 = $var2;Merlin--PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php reply | permalink Richard Lynch A 'var' is a 'property' of a Class instance. I want to display the users online on specific rooms only. have a peek here

Basically if you want to use classes you have to play by the rules Brad Bonkoski at Apr 11, 2006 at 11:57 am ⇧ Merlin wrote:chris smith schrieb:On 4/11/06, Merlin wrote:chris Members Login Username Password Remember Me Forgot your password? Is public $Priority inside a class or not? –MDI Jan 20 '11 at 21:51 the issue is more than likely on line 52, as the parser looks for the Create an account Resources Demo siteChronoforms start guideChronoForms for WordPress   2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com Terms of usePrivacy Policy Back http://stackoverflow.com/questions/2633252/cant-declare-even-the-most-simple-class-in-php-am-i-going-insane

Syntax Error Unexpected '$this' (t_variable) Expecting Function (t_function)

How to prove that a paper published with a particular English transliteration of my Russian name is mine? What does 'tirar los tejos' mean? Not sure why the version in cpanel differs from phpinfo() though. I just copied the exact same code, and it worked fine.

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Here's the error message: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/username/public_html/phpmailer/class.phpmailer.php on line 53 Line 53 according to DreamWeaver is public $Priority I stripped my script down to the most basic code (leaving in what is required by other code), and it still is calling this error.

And it says call to undefined function sanitize() –user1232117 May 1 '12 at 17:53 on my original post it points out to online.php line number 10 –user1232117 May 1 Expecting Function (t_function) Php If I do understand youright, I wouldalso have to call that function inside the class to get that value set?:function SetDBUsername($db_username) {$this->db_username = $db_username;}SetDBUsername();Is there not something more easy than that. I do not need to assign the value from outside theclass. FAQs!

Do these physical parameters seem plausible? Syntax Error, Unexpected '->' (t_object_operator) You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. share|improve this answer answered Jan 20 '11 at 23:31 jpwco 730614 Thanks, I think that worked but now I'm having issues connecting to the SMTP.

Expecting Function (t_function) Php

Join today Download & Extend Drupal Core Distributions Modules Themes TimesheetIssues Parse error: syntax error, unexpected T_VARIABLE ActiveProject:TimesheetVersion:4.7.x-1.x-devComponent:CodePriority:CriticalCategory:Bug reportAssigned:UnassignedReporter:siluriusCreated:February 14, 2007 - 18:33Updated:February 14, 2007 - 18:35 Log in or register http://board.phpbuilder.com/showthread.php?10331077-Parse-error-syntax-error-unexpected-T_VARIABLE-expecting-T_OLD_FUNCTION however in copy/pasting fireeyedboy's example below, i have replaced it with lowercase 'c'. Syntax Error Unexpected '$this' (t_variable) Expecting Function (t_function) I have the login data for a database savedin a fileand would like to use simply the variable $DB_login inside thisclass.This does not work:$this->db_username = $DB_login;That's the right way to do Syntax Error, Unexpected '$data' (t_variable), Expecting Function (t_function) Some people see this as nice because only your class has direct access to set your variables...so inside your 'set' function you can do validation, formatting, etc...

Top All times are GMT -4. navigate here Members of a class can be either data members (constants and properties) or methods. Browse other questions tagged php php-parse-error or ask your own question. show several lines either side and we should be able to help you. –RobertPitt Jan 20 '11 at 21:53 I downloaded the file directly from this link. Expecting T_function

Should I use "teamo" or "skipo"? protected function get_status_query($rn) { return "SELECT * FROM `online_users` WHERE `room` = '". more hot questions question feed lang-php about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Check This Out Ever. –Ignacio Vazquez-Abrams May 1 '12 at 17:38 Should have been typo.

Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts View Site Leaders What's New? Class Constructor Php Object-Oriented PHP Forum View Course 176 points Submitted by James Barclay about 3 years ago Confusing error with PHP objects - Unexpected T_VARIABLE, expecting T_FUNCTION Whenever I create a new instance Is this alternate history plausible? (Hard Sci-Fi, Realistic History) Why don't browser DNS caches mitigate DDOS attacks on DNS providers?

Some people see this as nice because onlyyour class has direct access to set your variables...so inside your'set' function you can do validation, formatting, etc...

If I do understand you right, Iwouldalso have to call that function inside the class to get that valueset?:function SetDBUsername($db_username) {$this->db_username = $db_username;}SetDBUsername();You cannot just call this function inside a class.In How do I "Install" Linux? I do not need to assign the value from outside the class. Parse Error Syntax Error Unexpected T_variable I have the login data for a database saved in a fileand would like to use simply the variable $DB_login inside this class.This does not work:$this->db_username = $DB_login;That's the right way

asked 6 years ago viewed 1244 times active 3 years ago Get the weekly newsletter! That protects you from accidentally closing or messing with the connection. Should find more info in the php man page describing the properties (php terminology for member) share|improve this answer answered Apr 13 '10 at 21:18 Eineki 10.7k42743 add a comment| Not this contact form If your not good with php you need to learn it not English.

What does the image on the back of the LotR discs represent? Most forums have them! For example $var1 = $var2; Merlin Merlin at Apr 11, 2006 at 11:40 am ⇧ chris smith schrieb:On 4/11/06, Merlin wrote:chris smith schrieb:On 4/11/06, Merlin wrote:Hi there,no much simpler. You can't put statements outside of functions in a class declaration, only variable declarations." Parse error: parse error, unexpected T_CLASS in Command line code on line 1 THERE IS AS YET

You have to state the visibility of the member with var or public or private combined with static keyword. This does not work: $this->db_username = $DB_login; Any idas on how to do this? Words that are both anagrams and synonyms of each other What does 'tirar los tejos' mean?