Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PHP Błąd Parse error: syntax error, unexpected '}', expecting ',' or ';'
KineQ
post
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 3.08.2014

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


Witam potrzebowałem skrypt na logowanie i wgrałem ten : http://rafal.brzezinski.me/logowanie_i_rejestracja .
Skrypt Działał Poprawnie ale jednak musiałem dodac rangę admin czyli User o numerze 0 to zwykły a 1 admin.

I dostałem taki error:
  1. Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/u350019633/public_html/login/2.php on line 10
.

W takim kodzie w pliku index.php :

  1. <?php
  2. include 'config.php';
  3. db_connect();
  4. check_login();
  5.  
  6. // pobieramy dane usera
  7. $user_data = get_user_data();
  8.  
  9. $ranga=$user_data['ranga'];
  10. if ($ranga=="0") {echo 'tresc dla zwykłych userów'};
  11. if ($ranga=="1") {echo 'tresc dla admina'};
  12.  
  13. db_close();
  14. ?>


Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
KineQ
post
Post #2





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 3.08.2014

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


Plik index.php
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Twój Magazyn</title>
  7. <link href="templatemo_style.css" rel="stylesheet" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="templatemo_site_title_bar_wrapper">
  11. <div id="templatemo_site_title_bar">
  12. <div id="site_title">
  13. <h1><a href="#">
  14. <img src="images/templatemo_logo.png" alt="myWORK" />
  15. <span>Twój Magazyn dla firm</span>
  16.  
  17. </a></h1>
  18. </div>
  19.  
  20. <ul class="social_network">
  21. <li><a href="https://www.facebook.com/twojmagazyn"><img src="images/facebook_icon.png" alt="facebook" /></a></li>
  22. </ul>
  23.  
  24. </div>
  25. </div>
  26.  
  27. <div id="templatemo_menu_wrapper">
  28.  
  29. <div id="templatemo_menu">
  30. <ul>
  31. <li><a href="index.php" class="current">Strona Główna</a></li>
  32. <li><a href="gallery.html">Moje Konto</a></li>
  33. <li><a href="gallery.html">Forum</a></li>
  34. <li><a href="gallery.html">Galeria</a></li>
  35. <li><a href="#" class="last">Kontakt</a></li>
  36. </ul>
  37. </div>
  38.  
  39.  
  40.  
  41. </div>
  42.  
  43.  
  44. <div id="templatemo_content">
  45.  
  46. <div id="twitter_section">
  47.  
  48. <p>" Twój Magazyn - Magazyn Dla Firm. "</p>
  49. <div class="followme"><a href="#"></a></div>
  50.  
  51. <div class="cleaner"></div>
  52. </div>
  53.  
  54. <div class="section_w600 margin_r_40">
  55.  
  56. <div class="cleaner_h40"></div>
  57.  
  58. <h2>Website Projects</h2>
  59.  
  60. <div class="featured_project margin_r_40">
  61.  
  62. <h3>Project One</h3>
  63. <img src="images/templatemo_image_01.jpg" alt="image" />
  64. <p>Nulla felis nibh, laoreet quis pharetra vel, rhoncus quis est. Pellentesque dictum blandit sagittis. Aenean hendrerit dolor quis nisl sollicitudin ornare.</p>
  65. <div class="button_02"><a href="#">Visit Site</a></div>
  66. </div>
  67.  
  68. <div class="featured_project">
  69.  
  70. <h3>Project Two</h3>
  71. <img src="images/templatemo_image_04.jpg" alt="image" />
  72. <p>In in neque nisl. Sed eget consectetur urna. Donec iaculis, nunc eu auctor vehicula, augue ipsum feugiat arcu, non euismod arcu nibh sit amet arcu.</p>
  73. <div class="button_02"><a href="#">Visit Site</a></div>
  74. </div>
  75.  
  76. <div class="cleaner_h10"></div>
  77. <div class="button_01"><a href="gallery.html">View All</a></div>
  78.  
  79. </div>
  80.  
  81. <div class="section_w300">
  82.  
  83. <h2>Latest Blog Posts</h2>
  84.  
  85. <div class="news_box">
  86. <a href="#">Fusce sit amet nunc lectus, at pretium augue. Pellentesque tortor felis, porttitor ac gravida quis, vestibulum at lorem. </a>
  87. <p class="post_info">Posted in <a href="#">News</a> by <a href="#">Admin</a> on <strong>October 23, 2024</strong></p>
  88. </div>
  89.  
  90. <div class="news_box">
  91. <a href="#">Integer imperdiet, justo ut venenatis vehicula, magna mi placerat felis, nec ornare lorem neque eget enim..</a>
  92. <p class="post_info">Posted in <a href="#">News</a> by <a href="#">Admin</a> on <strong>October 22, 2024</strong></p>
  93. </div>
  94.  
  95. <div class="news_box">
  96. <a href="#">Pellentesque id lectus nunc. Nullam quis faucibus massa. In ut vulputate nisi. Quisque aliquet, arcu id fringilla dictum.</a>
  97. <p class="post_info">Posted in <a href="#">News</a> by <a href="#">Admin</a> on <strong>October 21, 2024</strong></p>
  98. </div>
  99.  
  100. <div class="news_box">
  101. <a href="#">Aliquam vehicula accumsan arcu, vestibulum cursus purus lobortis eu. Pellentesque vitae neque non lorem vehicula adipiscing.</a>
  102. <p class="post_info">Posted in <a href="#">News</a> by <a href="#">Admin</a> on <strong>October 20, 2024</strong></p>
  103. </div>
  104.  
  105. <div class="cleaner_h20"></div>
  106.  
  107. <div class="button_01"><a href="gallery.html">View All</a></div>
  108.  
  109. </div>
  110.  
  111. <div class="cleaner"></div>
  112. </div>
  113.  
  114. </div>
  115. <div id="templatemo_content_bottom"></div>
  116.  
  117. <div id="templatemo_footer_wrapper">
  118. <div id="templatemo_footer">
  119.  
  120. <div class="section_w240">
  121.  
  122. <h3>Polityka Prywatności</h3>
  123.  
  124. <div class="sub_content">
  125. <p>Informacje o urządzeniu. Możemy gromadzić dane dotyczące urządzenia (takie jak model sprzętu, wersja systemu operacyjnego i unikalny identyfikator urządzenia, a także informacje o sieci komórkowej, w tym numer telefonu). Identyfikator urządzenia i numer telefonu nie zostaną wykorzystane bez zgody właściciela.</p>
  126.  
  127. </div>
  128.  
  129. </div>
  130.  
  131. <div class="section_w240">
  132.  
  133. <h3>Informację</h3>
  134.  
  135. <div class="sub_content">
  136.  
  137. <p>Strona Wykorzystuje HTML 4 Jak I CSS 3. </p>
  138.  
  139.  
  140. </div>
  141.  
  142. </div>
  143.  
  144. <div class="section_w240">
  145.  
  146. <h3>Partnerzy</h3>
  147.  
  148. <div class="sub_content">
  149.  
  150. <ul class="footer_list">
  151. <li><a href="http://www.kineq.tk" target="_parent">KineQ</a></li>
  152. </ul>
  153.  
  154. </div>
  155.  
  156. </div>
  157.  
  158. <div class="section_w240">
  159.  
  160. <h3>Więcej</h3>
  161.  
  162. <div class="sub_content">
  163.  
  164. <ul class="footer_list">
  165. <li><a href="#">Forum</a></li>
  166. <li><a href="#">Dotację</a></li>
  167. <li><a href="#">Wykup Licęcji</a></li>
  168. <li><a href="#">Pomoc</a></li>
  169. </ul>
  170.  
  171. </div>
  172.  
  173. </div>
  174.  
  175. <div class="cleaner_h40"></div>
  176.  
  177. <center>
  178. Copyright ˆ 2014 <a href="#">Twój Magazyn</a> |
  179. Designed by <a href="http://www.kineq.tk" target="_parent">KineQ</a> |
  180. Twój Magazyn by <a href="http://www.kineq.tk" title="" target="_blank">KineQ</a>
  181. </center>
  182.  
  183. </div>
  184. </div>
  185. <div class="section_w940">
  186. <?php
  187. include '2.php';
  188. ?>
  189. </div>
  190. </body>
  191. </html>

Plik 2.php
  1. <?php
  2. include 'config.php';
  3. db_connect();
  4. check_login();
  5.  
  6. // pobieramy dane usera
  7. $user_data = get_user_data();
  8.  
  9. $ranga=$user_data['ranga'];
  10. if ($ranga=="0") {echo '<font color=aqua size=5>Witaj Użytkowniku </font>';}
  11. if ($ranga=="1") {echo '<font color=aqua size=5>Witaj Adminie </font>';}
  12.  
  13. db_close();
  14. ?>

Szablon Darmowy jak pisałem @UP wydaje mi się że nie ma błędu.
Go to the top of the page
+Quote Post

Posty w temacie
- KineQ   PHP Błąd Parse error: syntax error, unexpected '}', expecting ',' or ';'   3.08.2014, 20:21:54
- - kicaj   [PHP] pobierz, plaintext if ($ranga=="0...   3.08.2014, 20:35:42
- - KineQ   Działa dzięki a jak dodać żeby admin widział treść...   3.08.2014, 20:41:05
|- - MenTo(S)   Cytat(KineQ @ 3.08.2014, 21:41:05 ) D...   4.08.2014, 22:59:41
- - MenTo(S)   Może coś takiego ? [PHP] pobierz, plaintext <?p...   3.08.2014, 21:10:50
- - KineQ   Na razie zostaje tak ja mam. Jednak mam 2 kłopot. ...   3.08.2014, 21:23:16
|- - MenTo(S)   Cytat(KineQ @ 3.08.2014, 22:23:16 ) N...   3.08.2014, 21:30:35
- - KineQ   Plik index.php [PHP] pobierz, plaintext  ...   3.08.2014, 21:38:05
- - MenTo(S)   Wykasuj z kodu i sprawdź czy będzie OK. [PHP] pobi...   3.08.2014, 21:45:22
- - KineQ   Po wykasowaniu tego działa bo to kod od wczytania ...   3.08.2014, 21:48:38
- - MenTo(S)   Dobra powiedz mi co ty chcesz osiągnąć poprzez zał...   3.08.2014, 22:03:34
- - KineQ   plik 2.php to plik od sprawdzania czy ktoś jest za...   3.08.2014, 22:06:01
- - MenTo(S)   Zobacz takie rozwiązanie... [PHP] pobierz, plaint...   3.08.2014, 23:00:16
- - KineQ   Gdy się wylogowałem pisało Witaj Użytkowniku a po ...   4.08.2014, 17:23:53
|- - MenTo(S)   Cytat(KineQ @ 4.08.2014, 18:23:53 ) G...   4.08.2014, 21:31:10
- - KineQ   Na Podglądzie live gdy się nie zaloguje widzę treś...   4.08.2014, 22:31:10
|- - MenTo(S)   Cytat(KineQ @ 4.08.2014, 23:31:10 ) N...   4.08.2014, 22:49:28
- - KineQ   W 2 miejscach podaje się treść dla usera i admina ...   4.08.2014, 22:53:26
|- - MenTo(S)   Cytat(KineQ @ 4.08.2014, 23:53:26 ) W...   4.08.2014, 22:55:13
- - KineQ   Wiem tylko napis tresc dla zwykłych userów się też...   4.08.2014, 22:57:46
- - KineQ   Dobra mój błąd a da rade żeby treść dla usera była...   4.08.2014, 23:01:27
- - MenTo(S)   Podmień na to... Testowane działa. [PHP] pobierz,...   4.08.2014, 23:17:27
- - KineQ   Konto admina widzi tylko treść użytkownika. [PHP]...   5.08.2014, 21:43:51


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

 



RSS Aktualny czas: 9.10.2025 - 01:04