Error Unexpected T_string Expecting T_function
Contents |
here for a quick overview of the site Help Center Detailed answers to any syntax error unexpected t_string expecting function t_function questions you might have Meta Discuss the workings and policies php expecting function (t_function) of this site About Us Learn more about Stack Overflow the company Business Learn more about
Parse Error: Syntax Error, Unexpected ';', Expecting Function (t_function)
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
Parse Error: Syntax Error, Unexpected 'echo' (t_echo)
is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes 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 ->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,58111833 asked May 22 '12 at 15:02 Joe Fusco 615 closed as too localized by Colin, Gordon, markus,
unexpected T_STRING, expecting T_FUNCTION? How can I fix that syntax error, unexpected T_STRING, expecting T_FUNCTION? icemanblabla00 @icemanblabla00 5 months, 3 weeks ago I use wordpress theme and I added some codes in functions.php . Here there: https://gist.github.com/tomhemsley/4d19646f57a0a1f20709 Then, I saw that: Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /home/elmacocu/public_html/wp-content/themes/hueman/functions.php on line 58 FULL CODE HERE: http://stackoverflow.com/questions/10704705/unexpected-t-string-expecting-t-function the Humean WordPress theme with your own custom code is to create a child theme. * You can add temporary code snippets and hacks to the current functions.php file, but unlike with a child theme, they will be lost on upgrade. * * If you don't know what a child theme is, you really https://wordpress.org/support/topic/how-can-i-fix-that-syntax-error-unexpected-t_string-expecting-t_function/ want to spend 5 minutes learning how to use child themes in WordPress, you won't regret it 🙂 ! * https://codex.wordpress.org/Child_Themes * */ /** * CLASS LIMIT LOGIN ATTEMPTS * Prevent Mass WordPress Login Attacks by setting locking the system when login fail. * To be added in functions.php or as an external file. */ if ( ! class_exists( ‘Limit_Login_Attempts' ) ) { class Limit_Login_Attempts { var $failed_login_limit = 3; //Giris Denemesi var $lockout_duration = 1800; //Sureyi sn cinsinden giriniz. 30 dakika: 60*30 = 1800 var $transient_name = ‘attempted_login'; //Transient used public function __construct() { add_filter( ‘authenticate', array( $this, ‘check_attempted_login' ), 30, 3 ); add_action( ‘wp_login_failed', array( $this, ‘login_failed' ), 10, 1 ); } /** * Lock login attempts of failed login limit is reached */ public function check_attempted_login( $user, $username, $password ) { if ( get_transient( $this->transient_name ) ) { $datas = get_transient( $this->transient_name ); if ( $datas[‘tried'] >= $this->failed_login_limit ) { $until = get_option( ‘_transient_timeout_' . $this->tr
tour help Tour Start 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 http://wordpress.stackexchange.com/questions/155303/cant-activate-plugin-unexpected-t-string-expecting-t-function Us Learn more about Stack Overflow the company Business Learn more about hiring http://board.phpbuilder.com/showthread.php?10366062-RESOLVED-Parse-error-syntax-error-unexpected-T_STRING-expecting-T_OLD_FUNCTION-or-T_FUNCTIO developers or posting ads with us WordPress Development Questions Tags Users Badges Unanswered Ask Question _ WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer syntax error The best answers are voted up and rise to the top Can't activate Plugin: unexpected T_STRING, expecting T_FUNCTION [closed] up vote 0 down vote favorite I'm writing a plugin but have a problem. I wanted to make an upload form for my existing plugin, so I don't need to upload every picture with the Media Uploader and Copy&Paste the URL in the form. I used this error unexpected t_string tutorial: Tutorial Now, when I wanted to install the updated Plugin I get the following error message: Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /var/www/intern/wpkkbk/wp-content/plugins/widget-plugin.php_/widget-plugin.php on line 133 The code I added looks like this (line 133: add_action(...)): function my_admin_script($hook) { if ($hook != 'widgets.php') return; wp_enqueue_media(); wp_register_script('my-admin-js', plugins_url('widget-plugin.php_/js/upload.js', dirname(__FILE__)), array('jquery')); wp_enqueue_script('my-admin-js'); } add_action('admin_enqueue_scripts', 'my_admin_script'); I don't know, where I made a mistake. It didn't even work, when I used the exact same code from the tutorial. Any suggestions! plugins errors share|improve this question edited Jul 21 '14 at 16:03 Pieter Goosen 37.1k113687 asked Jul 21 '14 at 15:50 Andoril 61 closed as off-topic by Pieter Goosen, Johannes Pille, kaiser♦ Jul 22 '14 at 9:07 This question appears to be off-topic. The users who voted to close gave this specific reason:"Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?" – Pieter Goosen, Johannes Pille, kaiserIf this question can be reworded to fit the rules in the help center, please edit the question. Check your brackets inside wp_register_script() -
T_OLD_FUNCTION or T_FUNCTIO If this is your first visit, be sure to check out 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 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 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"