Php Syntax Error Unexpected T_string 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 php expecting function (t_function) and policies of this site About Us Learn more about Stack Overflow
Php Parse Error: Syntax Error, Unexpected 'define' (t_string)
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation parse error: syntax error, unexpected ';', expecting function (t_function) 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
Parse Error: Syntax Error, Unexpected 'echo' (t_echo)
only takes a minute: Sign up php Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION on construct up vote 1 down vote favorite hey guys was hoping you could help me out.. just to let u know in advance, im a relatively new php coder, doing a practice project, and came across this problem and ive spent like an hour of parse error syntax error unexpected ' ' in php rechecking and googling but just cant figure out whats causing it error: Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in C:\wamp\www\forum\classes\ClassUser.php on line 7 the segment of the code causing the problem: include $_SERVER["DOCUMENT_ROOT"]."forum/classes/general.inc"; Class User{ __construct($u,$p){ //this is line 7 $user=$u; if(strlen($p)>30|| empty($p) || !preg_match('/[^a-zA-Z0-9]/i',$p)){ $password=0; } else{ $password=hash_hmac('md5',$p,KEY); } } oh and since im new to php, incase im doing something which i should not be, please to recommend.. thanks in advance. note:ive removed the php tags since they seemed to be messing with the formatting of this post :/ note2: im also getting another notice Notice: Use of undefined constant KEY - assumed 'KEY' in C:\wamp\www\forum\classes\general.inc on line 20 but im assuming thats more of a warning than an error... but just adding incase it has something to do with the error general.inc: //error definations define("ERROR_FIELD_EMPTY","Error! All required fields not filled"); define("ERROR_INVALID_SIGNIN","Error! Username/password do not match!"); define("ERROR_GENERAL_INPUT", "Error! Invalid input given"); define("ERROR_SQL_CONNECT","Error! Could not connect to sql database"); //field sizes define("PASSWORD_LENGTH",12); define("USERNAME_LENGTH",30); //sql server details define("SQL_SERVER_NAME","localhost"); define("SQL_SERVER_USERNAME","root"); define("SQL_SERVER_PASSWORD",""); define("SQL_SERVER_DATABASE","forums"); define(KEY,"key"); function __autoload($className){ require_once($_SERVER["DOCUMENT_ROOT"]."forum/classes/Class$className.php"); } ClassU
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
Php Define
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: Sign up PHP: syntax error, unexpected T_STRING [closed] up vote 1 down http://stackoverflow.com/questions/10872097/php-parse-error-syntax-error-unexpected-t-string-expecting-t-function-on-cons vote favorite I am getting a syntax error for this PHP code syntax error, unexpected T_STRING It says line 2, which is the include line: http://stackoverflow.com/questions/10783733/php-syntax-error-unexpected-t-string Category List $result = mysql_query('SELECT category_id,category_name FROM gallery_category'); while($row = mysql_fetch_array($result)) { $photo_category_list .= <<<__HTML_END \n __HTML_END; } mysql_free_result( $result ); // Lets build the Image Uploading fields while($counter <= $number_of_fields) { $photo_upload_fields .= <<<__HTML_END
Templates » How can I fix that syntax error, unexpected T_STRING, expecting T_FUNCTION? How can I fix that syntax error, unexpected T_STRING, https://wordpress.org/support/topic/how-can-i-fix-that-syntax-error-unexpected-t_string-expecting-t_function/ expecting T_FUNCTION? icemanblabla00 @icemanblabla00 6 months 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: transient_name ) ) { $datas = get_transient( $this->trans