Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Parse error - prosze o pomoc
Forum PHP.pl > Forum > Przedszkole
djpetrox
Witam pojawił mi się taki błąd

  1. Parse error: syntax error, unexpected T_ELSE in /domains/*****public_html/common.php on line 229


  1. include($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx);
  2. }
  3. }
  4. else
  5. {
  6. header("Location: $multiforums_setting[exist_error_url]");
  7. }
  8. {
  9. else
  10. {



Co trzeba poprawic
bartisz
  1. include($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx);
  2. }
  3. }
  4. else
  5. {
  6. header("Location: $multiforums_setting[exist_error_url]");
  7. }
  8. { <- usuń to,lub zmień na }
  9. else
  10. {

jakby dalej nie dzialalo - daj pelny kod.
Wicepsik
Forum to nie parser! Policz sobie klamry otwierające i zamykające. Gdybyś używał wcięć w kodzie to nie miałbyś problemu ze znalezieniem.
djpetrox
Cytat(bartisz @ 29.01.2011, 13:07:06 ) *
  1. include($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx);
  2. }
  3. }
  4. else
  5. {
  6. header("Location: $multiforums_setting[exist_error_url]");
  7. }
  8. { <- usuń to,lub zmień na }
  9. else
  10. {

jakby dalej nie dzialalo - daj pelny kod.


no ne pomogło

  1. <?php
  2. /***************************************************************************
  3.  * common.php
  4.  * -------------------
  5.  * begin : Saturday, Feb 23, 2001
  6.  * copyright : (C) 2001 The phpBB Group
  7.  * email : support@phpbb.com
  8.  *
  9.  * $Id: common.php,v 1.74.2.25 2006/05/26 17:46:59 grahamje Exp $
  10.  *
  11.  ***************************************************************************/
  12.  
  13. /***************************************************************************
  14.  *
  15.  * This program is free software; you can redistribute it and/or modify
  16.  * it under the terms of the GNU General Public License as published by
  17.  * the Free Software Foundation; either version 2 of the License, or
  18.  * (at your option) any later version.
  19.  *
  20.  ***************************************************************************/
  21.  
  22. if ( !defined('IN_PHPBB') )
  23. {
  24. die("Hacking attempt");
  25. }
  26.  
  27. //
  28. error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
  29. set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
  30.  
  31. // The following code (unsetting globals)
  32. // Thanks to Matt Kavanagh and Stefan Esser for providing feedback as well as patch files
  33.  
  34. // PHP5 with register_long_arrays off?
  35. if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off'))
  36. {
  37. $HTTP_POST_VARS = $_POST;
  38. $HTTP_GET_VARS = $_GET;
  39. $HTTP_SERVER_VARS = $_SERVER;
  40. $HTTP_COOKIE_VARS = $_COOKIE;
  41. $HTTP_ENV_VARS = $_ENV;
  42. $HTTP_POST_FILES = $_FILES;
  43.  
  44. // _SESSION is the only superglobal which is conditionally set
  45. if (isset($_SESSION))
  46. {
  47. $HTTP_SESSION_VARS = $_SESSION;
  48. }
  49. }
  50.  
  51. // Protect against GLOBALS tricks
  52. if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS']))
  53. {
  54. die("Hacking attempt");
  55. }
  56.  
  57. // Protect against HTTP_SESSION_VARS tricks
  58. if (isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS))
  59. {
  60. die("Hacking attempt");
  61. }
  62.  
  63. if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
  64. {
  65. // PHP4+ path
  66. $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');
  67.  
  68. // Not only will array_merge give a warning if a parameter
  69. // is not an array, it will actually fail. So we check if
  70. // HTTP_SESSION_VARS has been initialised.
  71. if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS))
  72. {
  73. $HTTP_SESSION_VARS = array();
  74. }
  75.  
  76. // Merge all into one extremely huge array; unset
  77. // this later
  78. $input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);
  79.  
  80. unset($input['input']);
  81. unset($input['not_unset']);
  82.  
  83. while (list($var,) = @each($input))
  84. {
  85. if (in_array($var, $not_unset))
  86. {
  87. die('Hacking attempt!');
  88. }
  89. unset($$var);
  90. }
  91.  
  92. unset($input);
  93. }
  94.  
  95. //
  96. // addslashes to vars if magic_quotes_gpc is off
  97. // this is a security precaution to prevent someone
  98. // trying to break out of a SQL statement.
  99. //
  100. {
  101. if( is_array($HTTP_GET_VARS) )
  102. {
  103. while( list($k, $v) = each($HTTP_GET_VARS) )
  104. {
  105. if( is_array($HTTP_GET_VARS[$k]) )
  106. {
  107. while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
  108. {
  109. $HTTP_GET_VARS[$k][$k2] = addslashes($v2);
  110. }
  111. @reset($HTTP_GET_VARS[$k]);
  112. }
  113. else
  114. {
  115. $HTTP_GET_VARS[$k] = addslashes($v);
  116. }
  117. }
  118. @reset($HTTP_GET_VARS);
  119. }
  120.  
  121. if( is_array($HTTP_POST_VARS) )
  122. {
  123. while( list($k, $v) = each($HTTP_POST_VARS) )
  124. {
  125. if( is_array($HTTP_POST_VARS[$k]) )
  126. {
  127. while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
  128. {
  129. $HTTP_POST_VARS[$k][$k2] = addslashes($v2);
  130. }
  131. @reset($HTTP_POST_VARS[$k]);
  132. }
  133. else
  134. {
  135. $HTTP_POST_VARS[$k] = addslashes($v);
  136. }
  137. }
  138. @reset($HTTP_POST_VARS);
  139. }
  140.  
  141. if( is_array($HTTP_COOKIE_VARS) )
  142. {
  143. while( list($k, $v) = each($HTTP_COOKIE_VARS) )
  144. {
  145. if( is_array($HTTP_COOKIE_VARS[$k]) )
  146. {
  147. while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
  148. {
  149. $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
  150. }
  151. @reset($HTTP_COOKIE_VARS[$k]);
  152. }
  153. else
  154. {
  155. $HTTP_COOKIE_VARS[$k] = addslashes($v);
  156. }
  157. }
  158. @reset($HTTP_COOKIE_VARS);
  159. }
  160. }
  161.  
  162. //
  163. // Define some basic configuration arrays this also prevents
  164. // malicious rewriting of language and otherarray values via
  165. // URI params
  166. //
  167. $board_config = array();
  168. $userdata = array();
  169. $theme = array();
  170. $images = array();
  171. $lang = array();
  172. $nav_links = array();
  173. $dss_seeded = false;
  174. $gen_simple_header = FALSE;
  175.  
  176. // Start Multi-Forums Mod
  177. include $phpbb_root_path . "config/multiforums.config.inc.php";
  178.  
  179. if ($_GET["mforum"]==true) {
  180. setcookie ("ForumSetCookie", $_GET["mforum"], time()+31536000);
  181. $mforum = $_GET["mforum"];
  182. }
  183. else
  184. {
  185. $mforum = $_COOKIE["ForumSetCookie"];
  186. }
  187.  
  188. if ($mforum==false) {
  189. header("Location: $multiforums_setting[noforum_error_url]");
  190. }
  191. else
  192. {
  193. if(is_file($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx))
  194. {
  195. if ($multiforums_setting[master_offline] == "1")
  196. {
  197. header("Location: $multiforums_setting[offline_error_url]");
  198. }
  199. else
  200. {
  201. $resultlink = mysql_query("SELECT * FROM `multiforums_forums` WHERE 1 AND `access_name` LIKE '$mforum' LIMIT 0 , 1");
  202. if ($forum = mysql_fetch_array($resultlink)) {
  203. if ($forum[bannerless] == "1") {
  204. $this_forum_bannerless = "1";
  205. }
  206. else
  207. {
  208. $this_forum_bannerless = "0";
  209. }
  210.  
  211. if ($forum[online] == false) {
  212. header("Location: $multiforums_setting[offline_error_url]");
  213. }
  214. }
  215.  
  216. include($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx);
  217. }
  218. }
  219. else
  220. {
  221. header("Location: $multiforums_setting[exist_error_url]");
  222. }
  223. }
  224. else
  225. {
  226. if(is_file($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx))
  227. {
  228. if ($multiforums_setting[master_offline] == "1")
  229. {
  230. header("Location: $multiforums_setting[offline_error_url]");
  231. }
  232. else
  233. {
  234. $resultlink = mysql_query("SELECT * FROM `multiforums_forums` WHERE 1 AND `access_name` LIKE '$mforum' LIMIT 0 , 1");
  235. if ($forum = mysql_fetch_array($resultlink)) {
  236. if ($forum[bannerless] == "1") {
  237. $this_forum_bannerless = "1";
  238. }
  239. else
  240. {
  241. $this_forum_bannerless = "0";
  242. }
  243.  
  244. if ($forum[online] == false) {
  245. header("Location: $multiforums_setting[offline_error_url]");
  246. }
  247. }
  248.  
  249. include($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx);
  250. }
  251. }
  252. else
  253. {
  254. header("Location: $multiforums_setting[exist_error_url]");
  255. }
  256. }
  257. // End Multi-Forums Mod
  258.  
  259. if( !defined("PHPBB_INSTALLED") )
  260. {
  261. //header("Location: install/install.$phpEx");
  262. echo "If you are seeing this then you system is not install correctly (wants to install!)";
  263. }
  264.  
  265. include($phpbb_root_path . 'includes/constants.'.$phpEx);
  266. include($phpbb_root_path . 'includes/template.'.$phpEx);
  267. include($phpbb_root_path . 'includes/sessions.'.$phpEx);
  268. include($phpbb_root_path . 'includes/auth.'.$phpEx);
  269. include($phpbb_root_path . 'includes/functions.'.$phpEx);
  270. include($phpbb_root_path . 'includes/db.'.$phpEx);
  271.  
  272. // We do not need this any longer, unset for safety purposes
  273. unset($dbpasswd);
  274.  
  275. //
  276. // Obtain and encode users IP
  277. //
  278. // I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as
  279. // private range IP's appearing instead of the guilty routable IP, tough, don't
  280. // even bother complaining ... go scream and shout at the idiots out there who feel
  281. // "clever" is doing harm rather than good ... karma is a great thing ... :)
  282. //
  283. $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
  284. $user_ip = encode_ip($client_ip);
  285.  
  286. //
  287. // Setup forum wide options, if this fails
  288. // then we output a CRITICAL_ERROR since
  289. // basic forum information is not available
  290. //
  291. $sql = "SELECT *
  292. FROM " . CONFIG_TABLE;
  293. if( !($result = $db->sql_query($sql)) )
  294. {
  295. message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
  296. }
  297.  
  298. while ( $row = $db->sql_fetchrow($result) )
  299. {
  300. $board_config[$row['config_name']] = $row['config_value'];
  301. }
  302.  
  303. if (file_exists('install') || file_exists('contrib'))
  304. {
  305. message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib');
  306. }
  307.  
  308. //
  309. // Show 'Board is disabled' message if needed.
  310. //
  311. if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
  312. {
  313. message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
  314. }
  315.  
  316. ?>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.