Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 11th, 2009, 02:43 PM
ausgezeichnete ausgezeichnete is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 71 ausgezeichnete User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 19 m 58 sec
Reputation Power: 3
Red face Parse error: syntax error, unexpected $end, expecting T_VARIABLE or '$'

am having this error in the SERVER and not in not my LOCAL


Parse error: syntax error, unexpected $end, expecting T_VARIABLE or '$' in /home/vozemg0/public_html/vozenow/admin/smarty/Smarty_Compiler.class.php on line 1632




any idea???????????????

Reply With Quote
  #2  
Old January 29th, 2009, 10:12 PM
jamestrowbridge jamestrowbridge is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2008
Location: Cleveland, Ohio, USA
Posts: 411 jamestrowbridge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 18 h 54 m 24 sec
Reputation Power: 2
post some of the code around line 1632 in that file if you need help....
__________________
Sir, a desire of knowledge is the natural feeling of mankind; and every human being, whose mind is not debauched, will be willing to give all that he has to get knowledge.

Reply With Quote
  #3  
Old March 20th, 2009, 10:01 PM
Iamgregor Iamgregor is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 7 Iamgregor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 4 sec
Reputation Power: 0
I'm having the exact same problem HELP!

I too have this error:
Parse error: syntax error, unexpected $end

ONLY on my live server NOT on my local machine or another server I tried. Both are using PHP and MySQL 5.

I've been debugging it for hours and nothing. I have no missing braces of anything that I can find.

Here's a link to the code (my part anyway, not the wordpress stuff, though I figure if wordpress had a problem, someone would have found it by now. Besides, this only happens when I activate my personal theme.

the code is at pastebinDOTcom/m2703ffd1

This is driving me nuts. What do I do!?!?

Reply With Quote
  #4  
Old March 20th, 2009, 11:42 PM
jamestrowbridge jamestrowbridge is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2008
Location: Cleveland, Ohio, USA
Posts: 411 jamestrowbridge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 18 h 54 m 24 sec
Reputation Power: 2
Can you post your code her and tell me what line you are getting it on (from your error log)?

Reply With Quote
  #5  
Old March 21st, 2009, 01:00 AM
Nilpo's Avatar
Nilpo Nilpo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Codewalkers Headquarters
Posts: 155 Nilpo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 27 m 30 sec
Reputation Power: 3
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
If you receive an error on your live server, and not your test server, or vice versa...it's most likely because the two are using different error notification settings.

In any case, you can't diagnose this error without seeing relevant code. It's generally a typo or a missing closing bracket/semicolon.
__________________
Don't like me? Click it.

Scripting problems? Windows questions? Ask the Windows Guru!

Stay up to date with all of my latest content. Follow me on Twitter!

Help us help you! Post your exact error message with these easy tips!

Reply With Quote
  #6  
Old March 21st, 2009, 08:00 AM
Iamgregor Iamgregor is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 7 Iamgregor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 4 sec
Reputation Power: 0
It says the error is on line 2 which is empty. I've messed with this file forever and nothing. I can only conclude it's in a file that loads BEFORE this one..
Code:
   1.
      <?php
   2.
       
   3.
              function jd_permalink_from_postname($postname)
   4.
              {
   5.
                      global $wpdb;
   6.
             
   7.
                      $post_id = jd_id_from_postname($postname);
   8.
                      return get_permalink($post_id);
   9.
              }
  10.
       
  11.
              function jd_id_from_postname($postname)
  12.
              {
  13.
                      global $wpdb;
  14.
             
  15.
                      $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name='$postname'");
  16.
                      return $post_id;
  17.
              }
  18.
             
  19.
              function jd_count_posts($an_ID)
  20.
              {
  21.
                      global $wpdb;
  22.
             
  23.
                      $total_count = 0;
  24.
                      $post_results = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent='$an_ID' ORDER BY post_date");
  25.
                      foreach ($post_results as $therow)
  26.
                      {       
  27.
                              // Apparently, attachments are also posts so an uploaded image was counting as a sub-page and messing this up so had to check that it's a page type
  28.
                              $is_sub = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent='$therow->ID' AND post_type='page'");
  29.
                              if ($is_sub)
  30.
                                      $total_count += jd_count_posts($therow->ID);            // Add all the pages that are recursivly in this subcategory
  31.
                              else
  32.
                                      $total_count++; // Here'a  page
  33.
                      }
  34.
                      return (int) $total_count;
  35.
              }
  36.
       
  37.
              // Returns an array of random numbers where the numbers are less than or equal to max, and don't repeat
  38.
              // Returns up to num_nums amount of numbers
  39.
              function jd_rand_array($max, $num_nums=2)
  40.
              {
  41.
                      if ($num_nums > $max)
  42.
                              $num_nums = $max;
  43.
                      $to_return = array();   // Returns the set of numbers in an array
  44.
                      $return_count = 0;              // The return array must be sequential
  45.
                      $used = "-";                            // Tracks the numbers that have been used so there's no repeats. Leading - to prevent the strpos = 0 problem
  46.
                      do {
  47.
                              $test_num = rand()%$max;
  48.
                              if (!strpos($used,"-$test_num-"))       // there is no -randnum- substring in used, so it's not used
  49.
                              {
  50.
                                      $to_return[$return_count] = $test_num;  // Add the number to the return array
  51.
                                      $return_count++;                                                // One more number
  52.
                                      $used .= "-$test_num-";                                 // Now it's used
  53.
                              }       
  54.
                      } while ($return_count < $num_nums);
  55.
                      return $to_return;
  56.
              }
  57.
       
  58.
              function jt_last_comic()
  59.
              {
  60.
                      global $wpdb;
  61.
                     
  62.
                      $comic_parent = jd_id_from_postname("comics");
  63.
                      // On the query, have to check type equal a page or else it will pick up revisions, drafts, etc
  64.
                      $last = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_parent='$comic_parent' AND post_type='page'");            
  65.
                      return "comic".sprintf("%03d",$last);
  66.
              }
  67.
       
  68.
       
  69.
      /* Create widget compatible sidebars */
  70.
      if (function_exists("register_sidebar") )
  71.
      {
  72.
              register_sidebar(array('name'=>'Left',
  73.
              'before_widget' => '<table cellpadding=0 cellspacing=0 class="left_menu"><tr><td><img src="'.get_bloginfo('template_url').'/images/left_menu_top_left.gif"/></td><td class="menu_top" colspan=2></td><td><img src="'.get_bloginfo('template_url').'/images/menu_top_right.gif"/></td></tr><tr><td class="left_menu_left"></td><td class="menu_middle" colspan=2 valign="top">',
  74.
              'after_widget' => '</td><td class="menu_right"></td></tr><tr><td><img src="'.get_bloginfo('template_url').'/images/left_menu_bottom_left.gif"/></td><td class="left_menu_bottom_shadow"></td><td class="left_menu_bottom_noshadow"></td></td><td><img src="'.get_bloginfo('template_url').'/images/left_menu_bottom_right.gif"/></td></tr></table>',
  75.
              'before_title' => '<div class="left_menu_title">',
  76.
              'after_title' => '</div>',
  77.
              ));
  78.
             
  79.
              register_sidebar(array('name'=>'Right',
  80.
              'before_widget' => '<table cellpadding=0 cellspacing=0 class=right_menu><tr><td><img src="'.get_bloginfo('template_url').'/images/right_menu_top_left.gif"/></td><td class=menu_top colspan=2></td><td><img src="'.get_bloginfo('template_url').'/images/menu_top_right.gif"/></td></tr><tr><td class=right_menu_left></td><td class=menu_middle colspan=2 valign="top">',
  81.
              'after_widget' => '</td><td class=menu_right></td></tr><tr><td><img src="'.get_bloginfo('template_url').'/images/right_menu_bottom_left.gif"/></td><td class=right_menu_bottom_noshadow></td><td class=right_menu_bottom_shadow></td><td><img src="'.get_bloginfo('template_url').'/images/right_menu_bottom_right.gif"/></td></tr></table>',
  82.
              'before_title' => '<div class="right_menu_title">',
  83.
              'after_title' => '</div>',
  84.
              ));
  85.
      }
  86.
       
  87.
      ?>


Here's the header file. There are some wordpress files that load before this, but like I said before, they shouldn't be the problem since it's only when my template loads that there's trouble:

Code:
#
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
#
<!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"-->
#
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
#
 
#
<head profile="http://gmpg.org/xfn/11">
#
        <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
#
 
#
        <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
#
 
#
        <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
#
 
#
        <style type="text/css" media="screen">
#
                @import url( <?php bloginfo('stylesheet_url'); ?> );
#
        </style>
#
 
#
        <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
#
        <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
#
        <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
#
 
#
        <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
#
        <?php wp_get_archives('type=monthly&format=link'); ?>
#
        <?php //comments_popup_script(); // off by default ?>
#
        <?php wp_head(); ?>
#
</head>
#
 
#
<body>
#
 
#
<?php
#
        srand ((double) microtime() * 1000000);
#
        $t_index = rand(1,8);   // 1 to 4 inclusive
#
?>
#
<!-- The pop-up box; must be declared before including the js functions -->
#
<div id="jsInfo"></div>
#
 
#
<script src="<?php bloginfo('template_url') ?>/positioning.js"></script>
#
<script src="<?php bloginfo('template_url') ?>/functions.js"></script>
#
 
#
<!-- Now for layout stuff -->
#
<style>
#
<?php
#
        if ($GLOBALS["comic_mod"])
#
        {
#
                echo "#inner_content { margin-left:0; margin-right:0; width : 840px }";
#
                echo "#page_top_img, #page_bottom_img { margin-left: 196px;}";
#
                $page_bk_left_margin = "196px";
#
        }
#
        else
#
                $page_bk_left_margin = "150px";
#
?>
#
</style>
#
 
#
<!-- for the sidebars and content. Keep them in place -->
#
<table id=page_spacer cellpadding=0 cellspacing=0 style="background-position: <?php echo $page_bk_left_margin?>;">
#
<tr><td colspan="3" id="page_top_spacer" onclick="document.getElementById('login').style.display='bl  ock'" valign=left>
#
<a href="<?php bloginfo('url') ?>"/><img src='<?php bloginfo('template_url') ?>/images/jt_top.png' id=page_top_img /></td>
#
</tr>
#
<tr><td colspan="3" id="login">
#
<?php wp_loginout(); ?>
#
<?php wp_register(); ?>
#
<?php wp_meta(); ?>
#
</td></tr>
#
 
#
<tr>
#
 
#
<td id="left_column" valign="top" align="right" >
#
<!-- Browsers are stupid. Have to force them to keep the right width with images -->
#
<img src="<?php bloginfo('template_url') ?>/images/clear.gif" class="sidebar_spacer_img" />
#
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Left')) : ?>
#
Something's wrong with the sidebars. Call ADMIN!!!!
#
<?php endif; ?>
#
</td>
#
 
#
<td id="content" valign=top >
#
<div id="inner_content">
#
<!-- end header -->


By the way, I turned on all error reporting on my local machine and it didn't make any difference. This is the kind of thing that drives me nuts. If you fix this for me, I will be forever grateful

Last edited by Iamgregor : March 21st, 2009 at 08:09 AM. Reason: forgot something

Reply With Quote
  #7  
Old March 21st, 2009, 11:12 AM
Nilpo's Avatar
Nilpo Nilpo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Codewalkers Headquarters
Posts: 155 Nilpo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 27 m 30 sec
Reputation Power: 3
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
This usually indicates a missing opening or closing curly brace or a missing line-ending semi-colon.

I'm not seeing that in anything that you have here. Double check that your files are being saved as ANSI. It can cause weird issues if they're not.

Reply With Quote
  #8  
Old March 21st, 2009, 04:24 PM
jamestrowbridge jamestrowbridge is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2008
Location: Cleveland, Ohio, USA
Posts: 411 jamestrowbridge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 18 h 54 m 24 sec
Reputation Power: 2
Can you copy and paste the exact error you are getting?

The original post said it was line 1632... what changed?

Last edited by jamestrowbridge : March 21st, 2009 at 04:26 PM.

Reply With Quote
  #9  
Old March 21st, 2009, 04:34 PM
Iamgregor Iamgregor is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 7 Iamgregor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 4 sec
Reputation Power: 0
Quote:
Originally Posted by jamestrowbridge
Can you copy and paste the exact error you are getting?

The original post said it was line 1632... what changed?


I'm not the original poster. In my case, the error always shows up in the functions.php file, line 2. Which of course is impossible since there's nothing there, a <?php tag above it and a function declaration below. In theory that means the error must be in the header or something.

Reply With Quote
  #10  
Old March 21st, 2009, 04:46 PM
Iamgregor Iamgregor is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 7 Iamgregor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 4 sec
Reputation Power: 0
Quote:
Originally Posted by Nilpo
This usually indicates a missing opening or closing curly brace or a missing line-ending semi-colon.

I'm not seeing that in anything that you have here. Double check that your files are being saved as ANSI. It can cause weird issues if they're not.


How do I do that in windows? I'm just saving them standard text PHP files. Note that I have more than 7 separate wordpress installations running many varied kinds of sites. None of them have this problem.

Reply With Quote
  #11  
Old March 21st, 2009, 04:48 PM
Iamgregor Iamgregor is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 7 Iamgregor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 4 sec
Reputation Power: 0
I spent the last several hours reinstalling PHP mysql and apache from scratch using the most recent versions available. Still no error locally, only live.

Last edited by Iamgregor : March 21st, 2009 at 04:51 PM. Reason: oops

Reply With Quote
  #12  
Old March 21st, 2009, 05:54 PM
jamestrowbridge jamestrowbridge is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2008
Location: Cleveland, Ohio, USA
Posts: 411 jamestrowbridge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 18 h 54 m 24 sec
Reputation Power: 2
If there is stuff above the part you posted, you should post that too.

Reply With Quote
  #13  
Old March 22nd, 2009, 08:38 AM
Iamgregor Iamgregor is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 7 Iamgregor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 4 sec
Reputation Power: 0
Quote:
Originally Posted by jamestrowbridge
If there is stuff above the part you posted, you should post that too.


The problem is FIXED. I did some very careful testing and found out that it really WAS the functions.php file (even though I knew it couldn't be). I copied the text from the file and pasted it to a new blank text file. Then I erased the original, renamed the new file to the old file's name, and uploaded it. Tada!

This was one of the most annoying errors I've dealt with, but hopefully this experience will help someone else.

Reply With Quote
  #14  
Old March 23rd, 2009, 05:06 AM
Nilpo's Avatar
Nilpo Nilpo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Codewalkers Headquarters
Posts: 155 Nilpo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 27 m 30 sec
Reputation Power: 3
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
Quote:
Originally Posted by Iamgregor
The problem is FIXED. I did some very careful testing and found out that it really WAS the functions.php file (even though I knew it couldn't be). I copied the text from the file and pasted it to a new blank text file. Then I erased the original, renamed the new file to the old file's name, and uploaded it. Tada!

This was one of the most annoying errors I've dealt with, but hopefully this experience will help someone else.
That means that it was an encoding problem as I suggested.

Glad you got that working.

Reply With Quote
  #15  
Old March 23rd, 2009, 08:39 AM
Iamgregor Iamgregor is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 7 Iamgregor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 4 sec
Reputation Power: 0
Quote:
Originally Posted by Nilpo
That means that it was an encoding problem as I suggested.

Glad you got that working.


Yes, sorry for not attributing. I saw your suggestion, but couldn't try it directly since "ascii" is not an option for saving the files in Windows that I can see. If there's an easier way, please let me know so I don't have to copy to new files again.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Parse error: syntax error, unexpected $end, expecting T_VARIABLE or '$'


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek