Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php]jak zlikwidowac ten blad[php]
martino277
post 31.08.2007, 21:39:49
Post #1





Grupa: Zarejestrowani
Postów: 86
Pomógł: 0
Dołączył: 23.11.2006

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


siemka mam problem wyskakuje mi taki blad;Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in C:\Program Files\WebServ\httpd\index.php on line 105 i niewiem jak go zniwelowac prosze o porade dalej podaje kod skryptu w ktorym jest blad
  1. <?php
  2.  
  3.  
  4. define('VALID_ACCESS', '1');
  5.  
  6. require_once('./library/core.class.php');
  7. require_once('./library/database.class.php');
  8. require_once('./library/user.class.php');
  9. require_once('./library/photo.class.php');
  10. require_once('./library/comment.class.php');
  11. require_once('./library/category.class.php');
  12.  
  13. $Core = Core::get_instance();
  14. $Core->get_language();
  15. $Core->get_config();
  16. $Database = Database::get_instance();
  17. $User = User::get_instance();
  18. $Photo = Photo::get_instance();
  19. $Category = Category::get_instance();
  20. $Comment = Comment::get_instance();
  21.  
  22.  
  23. ?>
  24. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  25. <html>
  26. <head>
  27. <meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
  28. <link rel="stylesheet" href="style.css" type="text/css" />
  29. <meta name="Pragma" content="no-cache" />
  30. <title></title>
  31. </head>
  32. <body>
  33. <div id="head">
  34. <div id="top">
  35. <div id="top-left"></div>
  36. <div id="top-right">
  37.  
  38. <?php
  39.  
  40. if(isset($_SESSION['user_login']))
  41. {
  42. $Database->query("SELECT `id` FROM `#__photos` WHERE `author_id`='$_SESSION[user_id]'");
  43. echo '<p class="user-info">Jeste&para; zalogowany jako <b>'.$_SESSION['user_login'].'</b><br />
  44. Twoich zdjea w serwisie '.$Database->num_rows().'<br />
  45. <b><a href="index.php?task=show_user&id='.$_SESSION['user_id'].'">edytuj profil</a></b></p>';
  46. }
  47.  
  48. ?>
  49. </div>
  50. </div>
  51. <div id="panel">
  52. <table height="111px" valign="center" align="center" class="tabe-panel">
  53. <tr>
  54. <?php
  55.  
  56. $Database->query("SELECT `id`, `author_login`, `file_vsmall` FROM `#__photos` ORDER BY `id` D
    ESC LIMIT 5"
    );
  57.  
  58. while($row = $Database->fetch_array())
  59. {
  60. echo '<td><a href="index.php?task=show_photo&id='.$row['id'].'"><img class="img-panel" src="users/'.$row['author_login'].'/'.$row['file_vsmall'].'" /></a></td>'."\n".
  61. '<td width="50px"></td>'."\n\n";
  62. }
  63.  
  64. ?>
  65. </tr>
  66. </table>
  67. </div>
  68. <div id="body">
  69. <div id="menu">
  70. <p><a href="index.php">strona glowna</a> | 
  71. <a href="index.php?task=show_top_photos">najlepsze 20 fotek</a> |
  72. <a href="index.php?task=add_photo">dodaj foto</a> |
  73. <?php if(!isset($_SESSION['loged'])) echo '<a href="index.php?task=register_user">zarejestruj sie</a> |';?>
  74. <?php if(!isset($_SESSION['loged'])) echo '<a href="index.php?task=login">zaloguj sie</a> |';?>
  75. <?php if(isset($_SESSION['loged'])) echo '<a href="index.php?task=logout">wyloguj sie</a> |';?>
  76. <a href="kontakt.php">kontakt</a>
  77. regulamin | </p>
  78. </div>
  79. <div id="category">
  80. <p class="category">
  81. <?php
  82. echo '<b>'.LAN_CATEGORIES.'</b><br /><br />';
  83. foreach($Category->get_categories() as $id => $cat)
  84. {
  85. $id = $Category->get_category_id($cat);
  86. echo '<a href="index.php?task=show_from_category&id='.$id.'">'.$cat.'</a><br />'."\n";
  87. }
  88. ?></p>
  89. </div>
  90. <div id="main"><?php
  91. /**************************************************************************/
  92.  
  93.  
  94. if(isset($_GET['task']) && $_GET['task'] <> '')
  95. {
  96. $_GET['task'] = str_replace('/', '', $_GET['task']);
  97. require_once('./'.$_GET['task'].'.php');
  98. } else
  99. {
  100.  
  101. echo '<div id="photo">'.(isset($_GET['message']) ? ('<p class="error">'.$_GET['message'].'</p><br />') : ('')).'<p class="information">Strona g3ówna tra la lalala<br /><br />
  102.  error_reporting(0); //wylaczenie raportowania bledow
  103. $error= ''; //definiujemy zmienna
  104. if($_POST['done']) //jesli formularz zostal wyslany
  105. {
  106. $imie = stripslashes(trim($_POST["imie"]));//usuwamy niebezpieczne znaki
  107. $tresc = stripslashes(trim($_POST["tresc"]));
  108. $email = stripslashes(trim($_POST["email"]));
  109.  if (strlen($email)==0) { //jesli nie podal e-maila
  110. $error .= "<p>Nie podales adresu e-mail</p>";
  111. } else if (!eregi(".+@.+..+",$email)) { //sprawdzamy poprawnosc e-maila
  112. $error .= "<p>Email nie jest poprawny</p>";
  113. }
  114. if($_POST['tresc']=='')$error.="<p>Wypelnij pole 'tresc'</p>"; 
  115. if($_POST['imie']=='')$error.="<p>Podaj swoje imie!</p>";
  116. if($error == '') //jesli nie ma zadnych bledów
  117.  {
  118.  $_POST['done']='dodano'; //wysylamy emaila
  119.  $list = "$tresc\n\nNadawca: $imie - $email";
  120.  mail("tutaj@twoj-email.pl","List ze strony", $list, "From: $imie <$email>");
  121.  //tutaj zmien email na swój wlasny
  122. echo "Wiadomosc zostala wyslana poprawnie, dziekujemy...";
  123.  }
  124. }
  125.  
  126. if($_POST['done']!='dodano') //jesli nie wyslano emaila wyswielt formularz
  127. {
  128. echo '<font color="red">'.$error.'</font>
  129. <form action="form.php" method="post">
  130. <table >
  131. <tr><td>Imie i nazwisko:</td><td><input type="text" name="imie" value="'.$imie.'"></td></tr>
  132. <tr><td>Email:</td><td><input type="text" name="email" value="'.$email.'"></td></tr>
  133. <tr><td valign="TOP">Tresc:</td><td><textarea name="tresc" rows="5" cols="40">'.$tresc.'</textarea></td></tr>
  134. <tr><td colspan="2"><input type="submit" value="Wyslij" name="done"></td></tr>
  135. </table>
  136. ';
  137. }
  138.  
  139. </p></div>';
  140.  
  141. }
  142.  
  143.  
  144.  
  145.  
  146. /**************************************************************************/
  147. ?>
  148.  
  149. </div>
  150. </div>
  151. </div>
  152. <p class="footer">COPYRIGHT BY 2007</p>
  153. </body>
  154. </html>

za pomoc z gory dzieki pozdrawiam
Go to the top of the page
+Quote Post
batman
post 31.08.2007, 21:45:00
Post #2





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




Wiersz 102. Brakuje ';
Najłatwiej znaleźć podobny błąd patrząc na kolorowanie składni.


--------------------
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Go to the top of the page
+Quote Post
martino277
post 31.08.2007, 21:49:38
Post #3





Grupa: Zarejestrowani
Postów: 86
Pomógł: 0
Dołączył: 23.11.2006

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


dzieki kolego ale poradzilem sobie troche inaczej wstawilem ten formularz index.php?task=contact inne linki tak sa zrobione wczesniej niewiedzialem ze tak mozna dzieki za guitar.gif pomomoc i tak pozdrawiam
Go to the top of the page
+Quote Post
kurdak
post 1.09.2007, 16:55:23
Post #4





Grupa: Zarejestrowani
Postów: 36
Pomógł: 0
Dołączył: 1.05.2007
Skąd: Gryfino

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


Patrz na błędy jakie pokazuje przeglądarka.
Często jest tak że pokarze ze naprzykład w wierszu 103 jest błąd wtedy odrazu patrz na wiersz wyrzej i sprawdz czy tam nie ma braków.
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 19.07.2025 - 08:26