Parse Error Syntax Error Unexpected T_lnumber Eval
Contents |
here for a quick overview of the site Help Center Detailed answers to joomla parse error: syntax error, unexpected t_lnumber, expecting t_variable or '$' any questions you might have Meta Discuss the workings and policies parse error: syntax error, unexpected '2' (t_lnumber) of this site About Us Learn more about Stack Overflow the company Business Learn more syntax error unexpected 3 t_lnumber 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
Php T_lnumber
Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Mysql unexpected T_LNUMBER up vote 2 down vote favorite 1 I am trying to create a new row to a database using insert into in a php script but after hours looking into it i am getting an error of "syntax error, unexpected T_LNUMBER". I know that php screws it when it reach the "37bf7a30-b6cf-4642-89c9-031c1f6c34d0" string. I tried putting quotes and doublequotes there but nothing worked. Do you know any work arround maybe to help me out. Thanks a lot in advance and sorry for my bad english and the messy code. mysql_query("INSERT INTO `bbdb_item` (`id`, `application_id`, `type`, `name`, `alias`, `created`, `modified`, `modified_by`, `publish_up`, `publish_down`, `priority`, `hits`, `state`, `access`, `created_by`, `created_by_alias`, `searchable`, `elements`, `params`) VALUES ('$id', '1', 'item', '$name', '$alias', '$date', '$date', '42', '$date', '0000-00-00 00:00:00', '0', '0', '1', '1', '42', '', '1', ' {\n "37bf7a30-b6cf-4642-89c9-031c1f6c34d0": {\n "0": {\n "value": "http:\\/\\/www.xxxx.com\\/item\\/$id\\/overview.aspx",\n "text": "",\n "target": "0",\n "custom_title": "",\n "rel": ""\n }\n },\n "d3d4559f-24eb-46b2-a749-068ebd3eceb3": {\n "0": {\n "value": "$id"\n }\n },\n "0e366b7c-514a-4a37-b651-e6fe8edf78ff": {\n "0": {\n "value": "$country"\n }\n },\n ' {\n "metadata.title": "",\n "metadata.description": "",\n "metadata.keywords": "",\n "metadata.robots": "",\n "metadata.author": "",\n "config.enable_comments": "1",\
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: Sign up Syntax error, unexpected T_LNUMBER, expecting T_VARIABLE http://stackoverflow.com/questions/10283170/mysql-unexpected-t-lnumber or '$' up vote 3 down vote favorite I'm getting Syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' This is the code i'm using function wpse44503_filter_content( $content ) { $regex = '#src=("|\')'. '(/images/(19|20)(0-9){2}/(0|1)(0-9)/[^.]+\.(jpg|png|gif|bmp|jpeg))'. '("|\')#'; $replace = 'src="'.get_site_url( $2 ).'"'; $output = preg_replace( $regex, $replace, $content ); return $output; } This is the line where i'm getting that error $replace = 'src="'.get_site_url( $2 ).'"'; Can anyone help http://stackoverflow.com/questions/9571559/syntax-error-unexpected-t-lnumber-expecting-t-variable-or me to fix it? Thanks php regex preg-replace syntax-error share|improve this question asked Mar 5 '12 at 18:02 user1091558 1,52562138 What, exactly, is $2? –Jack Maney Mar 5 '12 at 18:06 1 $2 is an invalid PHP variable name.... "A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores." –Mark Baker Mar 5 '12 at 18:06 Are you trying to pass the second capture group $2 into that function? (Interesting how many people seem to have missed this.) –BoltClock♦ Mar 5 '12 at 18:07 @BoltClock Yes thats right. I'm trying to pass the second capture group into that function. What should i put there instead of $2 ? Thanks –user1091558 Mar 5 '12 at 18:10 What capture group? You haven't done a regex match (in the code that I can see) before the line $replace = 'src="'.get_site_url( $2 ).'"';. –Jack Maney Mar 5 '12 at 18:25 | show 1 more comment 4 Answers 4 active oldest votes up vote 2 down vote accepted What you're trying to do (ie replacing the matched string with the result of a f
Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. [SOLVED] Syntax https://forums.phpfreaks.com/topic/177174-solved-syntax-error-using-eval/ error using eval() Started by Johnain, Oct 10 2009 07:25 AM Please https://ellislab.com/forums/archive/viewreply/637433 log in to reply 7 replies to this topic #1 Johnain Johnain Advanced Member Members 64 posts Posted 10 October 2009 - 07:25 AM Hi AllI have never used eval() before to generate and execute php code.The code that I am trying to generate is a varying number syntax error of rows that should say (and execute) ... $incomingvariable = $_POST['incomingvariable'] ;... where the incoming variable will be 1_saleprice to (for example ) 10_saleprice when $pricecount (see below) has a value of 10The variable $pricecount has a value of 8 with the data I am using and it IS passed correctly (I use EngInSite debugger so I know that).I am syntax error unexpected using a for loop. The variable that holds the number of incoming records is called $pricecount. It reads like this ...93 for ($z = 1; $z <= $pricecount; $z += 1) 94 {95 $y = trim($z) ;96 97 $varval = "$" . $y . "_saleprice = $" . "_POST['" . $y . "_saleprice'] ;" ;9899 eval("\$varval = \"$varval\";");100 }You will see that I have put the terminating executing code semi-colon into the variable $varval in this example and I still get an error with or without it.(I split the $ and the _POST because otherwise it reads it directly as $_POST[')The error WITH the semi colon is ...Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/q07peri/public_html/admin/mdprodcodeedit.php(99) : eval()'d code on line 1The error WITHOUT the closing semi-colon is exactly the same. On my local box windows ...Apache 2.2.9PHP 5.2.-MySQL 5 Back to top #2 Daniel0 Daniel0 Advanced Member Staff Alumni 11,956 posts Posted 10 October 2009 - 07:36 AM Try to echo instea
Me? Password forgot password? This is an archived forum and may no longer be relevant. The active forums are here. Advanced Search unexpected T_LNUMBER error Ryan 2010 Posted: 14 September 2009 08:06 PM Joined: 2003-11-12265 posts I have the following code: {if event_end_date > current_time AND form_field_group == 6}