Parse Error Syntax Error Unexpected T_require_once Expecting T_function
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and syntax error, unexpected (t_string), expecting function (t_function) policies of this site About Us Learn more about Stack Overflow the php expecting function (t_function) company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users php parse error: syntax error, unexpected 'define' (t_string) Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes
Parse Error: Syntax Error, Unexpected ';', Expecting Function (t_function)
a minute: Sign up unexpected T_STRING, expecting T_FUNCTION [closed] up vote 0 down vote favorite Just learning how to work with php and mysql, using CodeIgniter. Running into that error. I am attempted to check login attempts against my database, where they are stored. Here are the related functions in my login model: public function verify_user($email, $password) { $q = $this ->db parse error: syntax error, unexpected 'echo' (t_echo) ->where('email_address', $email) ->where('password', $password) ->limit(1) ->get('users'); if ($q->num_rows > 0) return $q->row(); } add_login_attempt($email); return false; } public function add_login_attempt($email) { $current_attempts = get_login_attempts($email); if ($current_attempts > 2) { lock_account($email); } else { $updated_attempts = $current_attempts + 1; $data = array('login_attempts' => $updated_attempts); $this->db->where('email_address', $email); $this->db->update('crm', $data); } } function reset_login_attempts($email) { } function lock_account($email) { } public function get_login_attempts($email) { $this->db->select('login_attempts'); $this->db->from('crm'); $this->db->where('email_address', $email); $login_attempts = $this->db->get(); return $login_attempts; } } Logging in using correct credentials works no problem. When an incorrect password is entered, that error is encountered. Any help is greatly appreciated. php mysql codeigniter share|improve this question edited May 22 '12 at 15:07 ilanco 5,60111833 asked May 22 '12 at 15:02 Joe Fusco 615 closed as too localized by Colin, Gordon, markus, PeeHaa, hakre May 22 '12 at 22:28 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, vis
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: http://stackoverflow.com/questions/10704705/unexpected-t-string-expecting-t-function Sign up Php Error - Unexpected require_once expecting function up vote 0 down vote favorite 1 I'm currently trying to fetch the medoo framework so that I can begin easily retrieving data from my MySQL database... and for some reason it doesn't work! here's the code of my signin.php file http://stackoverflow.com/questions/23726288/php-error-unexpected-require-once-expecting-function $database = new medoo(); $email = $database->get('MM_Users', 'Email', [ 'ID' => 1 ]); return $email; } ?> And the error: Parse error: syntax error, unexpected 'require_once' (T_REQUIRE_ONCE), expecting function (T_FUNCTION) in /myfiledirectory/example.php on line 4 Any help is greatly appreciated! I'm not quite sure at what's going wrong. The php file that's running is : There's also a difference in the wrapping for require_once... this doesn't make a difference does it? And if so, which one is more advisable to use in a production environment? php php-include medoo share|improve this question edited May 18 '14 at 20:53 asked May 18 '14 at 20:00 muffinjello 85313 1 require_once 'medoo.min.php'; require_once('signin.php'); Spot the difference –Meredith May 18 '14 at 20:02 1 You said your code is from the signin.php file, but the error you pasted says it's in example.php. If you didn't change the error text, what is on line 4 of example.php? –myesain May 18 '14 at 20:04 BTW, you can use require_once with or without the pare
T_OLD_FUNCTION or T_FUNCTIO If this is your first visit, be sure to check out http://board.phpbuilder.com/showthread.php?10366062-RESOLVED-Parse-error-syntax-error-unexpected-T_STRING-expecting-T_OLD_FUNCTION-or-T_FUNCTIO the FAQ by clicking the link above. 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. Results 1 to 5 of 5 Thread: [RESOLVED] Parse error: syntax syntax error error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTIO Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 06-08-2009,03:25 AM #1 aarchaic View Profile View Forum Posts Member Join Date May 2009 syntax error, unexpected Location Pretoria, South Africa Posts 44 [RESOLVED] Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTIO Hello guys. I see there is a few threads on this subject but i have this problem the code looks ok to me but i'm not really up to scratch with functions or classes. this is the error... Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/site/public_html/pfp/magazine/db.php on line 6 here is the code. config.php PHP Code:
//ADMINSETTINGS//
define("ADMIN_PASSWORD","PASS");//AdminPassword
define("WEBSITE_NAME","FlashPageFlip");//YourWebsiteName
//MySQLSETTINGS//
define("HOST","localhost");//databasehost
def