473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Parse error, expecting `']'' in eval()'d code

11
Hi I am a newbie can anybody help me please?

I am gettin the following error

Parse error: parse error, expecting `']'' in c:\program files\easyphp1-8\www\webshop\routines\tSys.php(483) : eval()'d code on line 4

Thanks in advance for your help

Katie
Oct 21 '07 #1
18 3783
pbmods
5,821 Expert 4TB
Heya, Katie. Welcome to TSDN!

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

You're getting this error because there's a syntax error on line 4 in whatever code tSys.php eval()s on line 483.
Oct 21 '07 #2
kelbly
11
O thanks for that its very kind of, you!!

so, can you tell me how I sort it?!!

many thanks

katie
Oct 21 '07 #3
Markus
6,050 Expert 4TB
O thanks for that its very kind of, you!!

so, can you tell me how I sort it?!!

many thanks

katie
We need to see your code to help you - we're not, contrary to popular belief, psychic.

:)
Oct 21 '07 #4
kelbly
11
your not psychics!! lol

which code do u want!!

this from line 483- eval("?>".$this->templateContents);
Oct 21 '07 #5
pbmods
5,821 Expert 4TB
Heya, Katie.

What app are you running? Is this some kind of e-commerce suite?

I've run into similar problems with phpBB, and the solution was to purge the template cache. There might be a similar operation with the app that you are using.

Do you get this error on every page, or just a specific one?
Oct 21 '07 #6
kelbly
11
Yeh its Jshop server software I am using, it was working fine until I started using Coffecup HTML editer to rearrange the look of things then suddenly it happened!!

I am an extreme newbie where all this is concerned


It is a specific page, down the left side there are different store sections it happens when I click on one of them
Oct 21 '07 #7
RMWChaos
137 100+
kelby,

I would suggest that you do this:

1. open your tSys.php file, highlight all, then ctrl+c to copy it.
2. start a new reply and ctrl+v to paste the code you just copied.
3. wrap the whole code between [ code ] and [ /code ] (no spaces between the brackets, though).

When you post, we can see your code and try to help you sort out the error.
Oct 21 '07 #8
kelbly
11
my code doesnt seem to be showing up!
Oct 21 '07 #9
RMWChaos
137 100+
Are you typing

[ code ]

...your code here...

[ /code ]

but without any spaces between the brackets and the word code?
Oct 21 '07 #10
kelbly
11
Are you typing

[ code ]

...your code here...

[ /code ]

but without any spaces between the brackets and the word code?
yep

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.         function showPage() {        
  4.             ob_implicit_flush(0);
  5.             ob_start();
  6.             eval("?>".$this->templateContents);
  7.             $content = ob_get_contents();
  8.             ob_end_clean();
  9.             echo $content;
  10.         }
  11.  
  12.         function retrievePage() {
  13.             $this->templateContents = eregi_replace("\r\n","<full>",$this->templateContents);
  14.             ob_implicit_flush(0);
  15.             ob_start();
  16.             eval("?>".$this->templateContents);
  17.             $content = ob_get_contents();
  18.             ob_end_clean();
  19.             $content = eregi_replace("<full>","\r\n",$content);            
  20.             return $content;
  21.         }        
  22.  
  23.         function convertText($from,$to) {
  24.             $this->templateContents = eregi_replace($from,$to,$this->templateContents);
  25.         }        
  26.  
  27.         function addVariable($variableName,$variableValue) {
  28.             $this->theVariables[$variableName] = $variableValue;    
  29.         }
  30.  
  31.         function _RUNTIME_stringLimit($theString,$theLength,$limitAdd) {
  32.             if (strlen($theString) > $theLength) {
  33.                 $theString = substr($theString,0,$theLength);
  34.                 if ($limitAdd == "dots") {
  35.                     $theString .= "...";
  36.                 }
  37.             }
  38.             return $theString;
  39.         }
  40.  
  41.         function _returnError($theLine,$theError) {
  42.             echo "<b>Template Execution Halted!</b><br><b>Error:</b> $theLine ($theError)";
  43.             exit;
  44.         }
  45.     }
  46. ?>
  47.  
  48.  
Oct 21 '07 #11
kelbly
11
yep

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.         function showPage() {        
  4.             ob_implicit_flush(0);
  5.             ob_start();
  6.             eval("?>".$this->templateContents);
  7.             $content = ob_get_contents();
  8.             ob_end_clean();
  9.             echo $content;
  10.         }
  11.  
  12.         function retrievePage() {
  13.             $this->templateContents = eregi_replace("\r\n","<full>",$this->templateContents);
  14.             ob_implicit_flush(0);
  15.             ob_start();
  16.             eval("?>".$this->templateContents);
  17.             $content = ob_get_contents();
  18.             ob_end_clean();
  19.             $content = eregi_replace("<full>","\r\n",$content);            
  20.             return $content;
  21.         }        
  22.  
  23.         function convertText($from,$to) {
  24.             $this->templateContents = eregi_replace($from,$to,$this->templateContents);
  25.         }        
  26.  
  27.         function addVariable($variableName,$variableValue) {
  28.             $this->theVariables[$variableName] = $variableValue;    
  29.         }
  30.  
  31.         function _RUNTIME_stringLimit($theString,$theLength,$limitAdd) {
  32.             if (strlen($theString) > $theLength) {
  33.                 $theString = substr($theString,0,$theLength);
  34.                 if ($limitAdd == "dots") {
  35.                     $theString .= "...";
  36.                 }
  37.             }
  38.             return $theString;
  39.         }
  40.  
  41.         function _returnError($theLine,$theError) {
  42.             echo "<b>Template Execution Halted!</b><br><b>Error:</b> $theLine ($theError)";
  43.             exit;
  44.         }
  45.     }
  46. ?>
  47.  
  48.  

It hasnt copied it all in there, theres about 500 lines, do you think this is why?
Oct 21 '07 #12
pbmods
5,821 Expert 4TB
Heya, Katie.

There's a known problem with our forum's parsing engine; large amounts of code break it.

But we don't want to see that, anyway. We want to see the template that you were editing.
Oct 21 '07 #13
kelbly
11
Heya, Katie.

There's a known problem with our forum's parsing engine; large amounts of code break it.

But we don't want to see that, anyway. We want to see the template that you were editing.

erm it could have been one of about three!!

heres the one I think it probably is:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
  3. <HEAD><TITLE>{company.companyname} > {section.title}</TITLE>
  4. <META http-equiv=Content-Type content="text/html; charset=unicode">
  5. <META NAME="description" CONTENT={"meta.description}">
  6. <META NAME="keywords" CONTENT={"meta.keywords}">
  7. <META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
  8. <BODY>&lt;#include:includes/top.html#&gt;
  9.         <p>
  10.         <table cellpadding="2" cellspacing="1" border="0">
  11.             <tr>
  12.                 <td valign="top">&nbsp;</FONT></td>
  13.                 <td valign="top"><IMG height=93 alt={section.title} src="{section.thumbnail}" width=84 border=1></FONT></td>
  14.                 <td valign="top"><font class="header-title">{section.title}</font><br><font class="header-description">{section.fullDescription}</font></td>
  15.             </tr>
  16.         </table>
  17.         <p><center><!-- check if there are any sub-sections -->&lt;#if:loop.sections.total:neq:0#&gt;
  18.         <table cellpadding="2" cellspacing="1" border="0" width="98%">
  19.         <tr>
  20.             <td align="middle" colspan="3" class="table-backing-title"><font class="table-title-text">{labels.section.subSectionsTitle} {section.title}</font></td>
  21.         </tr><!-- output sub-sections --
  22.         >&lt;#loop:sections#&gt;
  23.             &lt;#if:loop.sections.count:mod2:1#&gt;
  24.                 <tr
  25.             >&lt;#/if#&gt;
  26.             <td class="table-backing-content" valign="top">
  27.                 <table border="0" cellpadding="2" cellspacing="0">
  28.                 <tr>
  29.                     <td valign="top"><A href="file:///C:/Program%20Files/EasyPHP1-8/www/webshop/templates/%7Bsections.link%7D" ><IMG height=93 alt={sections.title} src="{sections.thumbnail}" width=84 border=0></a></td>
  30.                     <td valign="top" align="left"><A class=middle-links href="{sections.link}">{sections.title}</a><br><font class="subsection-description">{sections.shortdescription}<br></font></td>
  31.                 </tr>
  32.                 </table>
  33.             </td
  34.             >&lt;#if:loop.sections.count:mod2:0#&gt;
  35.                 </tr>&lt;#/if#&gt; &lt;#/loop#&gt; 
  36. <!-- /output sub-sections -->
  37.         </table>&lt;#/if#&gt;        
  38.         <p><!-- check if there are any products in this section --
  39.         >&lt;#if:loop.products.total:neq:0#&gt;
  40.             <table cellpadding="2" cellspacing="2" border="0">
  41.             <tr>
  42.                 <td align="middle" colspan="4" class="table-backing-title"><font class="table-title-text">{labels.section.productsTitle} {section.title} ({labels.section.productsTotal} {sectionpages.totalproducts}, {labels.section.productsShowing} {sectionpages.from} -&gt; {sectionpages.to})</font></td>
  43.             </tr
  44.             >&lt;#loop:products#&gt;
  45.                     &lt;#if:loop.products.count:mod4:1#&gt;
  46.                         <tr>&lt;#/if#&gt; <!-- output product with individual add to basket form -->
  47.                     <form name="'{"products.form.name}"'" action="'{"products.form.action}"'" method="post" onSubmit="'{"products.form.onsubmit}"'">
  48.                     <td class="table-backing-content" valign="top">
  49.                         <table border="0" cellpadding="2" cellspacing="0">
  50.                         <tr>
  51.                             <td align="middle"><A href="file:///C:/Program%20Files/EasyPHP1-8/www/webshop/templates/%7Bproducts.link%7D" ><IMG height=120 alt={products.name} src="{products.thumbnail}" width=129 border=0></A></td>
  52.                         </tr>
  53.                         <tr>
  54.                             <td align="middle"><font class="product-field-title">{labels.product.productPrice}</A> <font class="product-field-content">{products.price}</font></font></td>
  55.                         </tr>
  56.                         <tr>
  57.                             <td align="middle"><A class=middle-links href="{products.link}">{labels.product.moreInfoLink}</A></td>
  58.                         </tr>
  59.                         <tr>
  60.                             <td align="middle"><A class=middle-links href="{products.wishlist.link}">{labels.customer.addToWishListLink}</A></td>
  61.                         </tr>
  62.                         <tr>
  63.                             <td align="middle"><A class=middle-links href="{products.add.link}">{labels.cart.addToCartLink}</A></td>
  64.                         </tr>
  65.                         </table>
  66.                     </td>
  67.                     </form><!-- /output product with individual add to basket form --
  68.                     >&lt;#if:loop.products.count:mod4:0#&gt;
  69.                         </tr
  70.                     >&lt;#/if#&gt;
  71.             &lt;#/loop#&gt;
  72.             </table><!-- output page navigation if there is more than one page in this section --
  73.             >&lt;#if:loop.sectionpages.pages.total:gt:1#&gt;
  74.             <p>
  75.             <table cellpadding="2" cellspacing="2" border="0" width="98%">        
  76.             <tr>
  77.                 <td class="table-backing-content" align="middle" >
  78.                     <font class="middle-normal-text"
  79.                     >&lt;#if:sectionpages.previouslink:neq:blank#&gt;
  80.                         [<A class=middle-links href="{sectionpages.previouslink}">{labels.section.previousLink}</a>]&nbsp;&nbsp;&nbsp;
  81.                     &lt;#/if#&gt;
  82.                     &lt;#loop:sectionpages.pages#&gt;
  83.                         &lt;#if:sectionpages.page:eq:search.pages.page#&gt;
  84.                             {sectionpages.pages.page}
  85.                         &lt;#else#&gt;
  86.                             <A class=middle-links href="{sectionpages.pages.link}">{sectionpages.pages.page}</a> 
  87.                         &lt;#/if#&gt;
  88.                     &lt;#/loop#&gt;
  89.                     &lt;#if:sectionpages.nextlink:neq:blank#&gt;
  90.                         &nbsp;&nbsp;&nbsp;[<A class=middle-links href="{sectionpages.nextlink}">{labels.section.nextLink}</a>]
  91.                     &lt;#/if#&gt;
  92.                     </font>
  93.                 </td>
  94.             </tr>        
  95.             </table>&lt;#/if#&gt; <!-- /output page navigation if there is more than one page in this section -->&lt;#/if#&gt;
  96.         </center>&lt;#include:includes/bottom.html#&gt;</p></BODY></HTML>
  97.  
  98.  
Oct 21 '07 #14
pbmods
5,821 Expert 4TB
Heya, Katie.

On lines 4 and 5, you have one quote inside the tag marker and one quote outside. I wonder if that's wreaking any havoc.
Oct 21 '07 #15
kelbly
11
just tried changing that and it made no difference.
thanks though
Oct 22 '07 #16
pbmods
5,821 Expert 4TB
Heya, Katie.

I don't see anything around line 4 that might have caused the problem.

Try this.

in tSys.php, alter line 482 to look like this:
Expand|Select|Wrap|Line Numbers
  1. echo $this->templateContents;
  2. exit;
  3.  
  4. eval("?>".$this->templateContents);
  5.  
Oct 22 '07 #17
kelbly
11
Ok I did this and the error disappeared but it didnt come up how It should!!!
Oct 22 '07 #18
kelbly
11
This is what is my code from line 480

Expand|Select|Wrap|Line Numbers
  1.  
  2. function showPage() {        
  3.             ob_implicit_flush(0);
  4.             ob_start();
  5.             eval("?>".$this->templateContents);
  6.             $content = ob_get_contents();
  7.             ob_end_clean();
  8.             echo $content;
  9.         }
  10.  
  11.         function retrievePage() {
  12.             $this->templateContents = eregi_replace("\r\n","<full>",$this->templateContents);
  13.             ob_implicit_flush(0);
  14.             ob_start();
  15.             eval("?>".$this->templateContents);
  16.             $content = ob_get_contents();
  17.             ob_end_clean();
  18.             $content = eregi_replace("<full>","\r\n",$content);            
  19.             return $content;
  20.         }        
  21.  
  22.         function convertText($from,$to) {
  23.             $this->templateContents = eregi_replace($from,$to,$this->templateContents);
  24.         }        
  25.  
  26.         function addVariable($variableName,$variableValue) {
  27.             $this->theVariables[$variableName] = $variableValue;    
  28.         }
  29.  
  30.         function _RUNTIME_stringLimit($theString,$theLength,$limitAdd) {
  31.             if (strlen($theString) > $theLength) {
  32.                 $theString = substr($theString,0,$theLength);
  33.                 if ($limitAdd == "dots") {
  34.                     $theString .= "...";
  35.                 }
  36.             }
  37.             return $theString;
  38.         }
  39.  
  40.         function _returnError($theLine,$theError) {
  41.             echo "<b>Template Execution Halted!</b><br><b>Error:</b> $theLine ($theError)";
  42.             exit;
  43.         }
  44.     }
  45. ?>
  46.  
  47.  
Oct 22 '07 #19

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: entoone | last post by:
I'm getting the following error Parse error: parse error, expecting `','' or `';'' in /home/notarywe/public_html/php/update2.php on line 108 Here is line 108 <input type="text" name="ud_first"...
2
by: radykl | last post by:
Can anyone explain me why you need to add open and close parenthesis to a JSON text in order to use eval() to parse it? For example: var json = "{a: 'abc', b: 'def'}"; var obj1 = eval("(" +...
5
by: Anna MZ | last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website: $sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')...
1
by: soidariti | last post by:
database error - parse error, unexpected $, expecting kEND AddUserAuthorisationToUsers.rb migration file 1. class AddUserAuthorisationToUsers < ActiveRecord::Migration 2. def self.up ...
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
4
kestrel
by: kestrel | last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on. Heres what i have <?php...
1
by: Phaelle | last post by:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' What does that error mean? I can´t find the mistake!! In another script, I have got another kind of mistake : parse...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
3
paulrajj
by: paulrajj | last post by:
hi to all, i am getting syntax error on my code.. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62 ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.