Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Bład w mojej stronie- prosze o poprawienie, index.php wyświetla mi bład i nie wiem co jest nie tak:(
ciawu
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 11.10.2006

Ostrzeżenie: (0%)
-----


Wyświetla mi się taki bład:
  1. <?php
  2. Parse error: syntax error, unexpected '{' in /home/tomek/public_html/test/index.php on line 3
  3. ?>

I nie wiem gdzie popełniłem bład. Proszę o poprawienie. sad.gif



  1. <?php
  2. try
  3. {
  4. define('ACCES', 0);
  5.  
  6. /**
  7. * Wczyttywanie klas
  8. */
  9. require_once('class/user.class.php');
  10. require_once('class/site.class.php');
  11. require_once('class/character.class.php');
  12.  
  13. /**
  14. * Definiowanie klas
  15. */
  16. $user = new User();
  17. $character = new Character();
  18. $site = new Site();
  19.  
  20. if (!isset($_GET['page']) || $_GET['page'] == '')
  21. {
  22. require_once('class/news.class.php');
  23. $news = new News;
  24. $arrNews = $news -> newsReturn();
  25. $tpl -> assign('News', $arrNews);
  26.  
  27. }
  28. elseif (isset($_GET['page']) && $_GET['page'] == 'login')
  29. {
  30. if (!empty($_POST['login']) || !empty($_POST['password']))
  31. {
  32. $logRes = $site -> login($_POST['login'], $_POST['password']);
  33. $tpl -> assign('Login', $logRes);
  34. }
  35. }
  36. elseif (isset($_GET['page']) && $_GET['page'] == 'register')
  37. {
  38. include('class/register.class.php');
  39. $register = new Register;
  40. if ($register -> checkRegister() != 0)
  41. {
  42. if (isset($_POST['login']) || isset($_POST['login']) || isset($_POST['password']) || isset($_POST['password2']) || isset($_POST['mail']))
  43. {
  44. $registerRes = $register -> adduser($_POST['login'], $_POST['password'], $_POST['password2'], $_POST['mail']);
  45. $tpl -> assign('Register', $registerRes);
  46. }
  47. else
  48. {
  49. $tpl -> assign('Register', 10);
  50. }
  51. }
  52. else
  53. {
  54. $registerRes = -1;
  55. $tpl -> assign('Register', $registerRes);
  56. }
  57. }
  58. elseif (isset($_GET['page']) && $_GET['page'] == 'comments')
  59. {
  60. require_once('class/news.class.php');
  61.  
  62. $news = new News;
  63. $new = $news -> newsById($_GET['id']);
  64.  
  65. $arrComm = array();
  66. $arrComm = $news -> commentsReturn($_GET['id']);
  67.  
  68. $tpl -> assign('Comments', $arrComm);
  69. $tpl -> assign('News', $new);
  70. if (isset($_POST['text']))
  71. {
  72. $commRes = $news -> addComment($_POST['text'], $_GET['id']);
  73. $tpl -> assign('CommRes', $commRes);
  74. }
  75. }
  76. else
  77. {
  78. $tpl -> assign('Login', -2);
  79. }
  80.  
  81. /**
  82. * Przekazywanie zmiennych do parsera OPT i wyswietlanie strony
  83. */
  84. if (!isset($_GET['page']))
  85. {
  86. $_GET['page'] = '';
  87. }
  88.  
  89. require_once('includes/footer.php');
  90.  
  91. $tpl -> assign('Page', $_GET['page']);
  92. $tpl -> parse('index.tpl');
  93. }
  94. catch(optException $exception)
  95. {
  96. optErrorHandler($exception);
  97. }
  98. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 10:24