Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Opis i problem z else:, Parse error: syntax error, unexpected T_ELSE
Adis92
post
Post #1





Grupa: Zarejestrowani
Postów: 146
Pomógł: 12
Dołączył: 9.01.2009
Skąd: Płock

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


Witajcie. Mam skrypt który ma za zadanie dodać opis o mnie. Niby wszystko ładnie tylko mam 1 błąd. A mianowicie:
  1. [b]Parse error:[/b] syntax error, unexpected T_ELSE in [b]/ścieżka do pliku/opis.php[/b] on line [b]34[/b]

a to plik opis.php
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
  2. <HTML>
  3. <HEAD>
  4. <meta http-equiv="Content-type" content="text/html"; charset=windows-1250">
  5. <meta name="author" content="Sunrise">
  6. <link rel="stylesheet" href="style.css" type="text/css">
  7. <title>dodaj opis</title>
  8. </HEAD>
  9.  
  10. <?php
  11. $tresc = $_POST['tresc'];
  12. $obrazek = '<img style="position: absolute; margin: 14px 10px 0px 100px;"src="images/blad.png">';
  13.  
  14. if($tresc) {
  15.  
  16. include("includes/db.inc.php");
  17.  
  18. $connection = mysql_connect($host, $user, $password)
  19. or die("".$obrazek. "<h5>Brak połączenia z serverem MySQL</h5>");
  20. $db = mysql_select_db($baza, $connection)
  21. or die("".$obrazek. "<h5>Brak połączenia z bazą danych</h5>");
  22.  
  23. mysql_query("SET NAMES 'cp1250'");
  24.  
  25. $ins = mysql_query("INSERT INTO opis SET tresc='$tresc'") or die("MySQL ERROR: ".mysql_error());
  26.  
  27. if($ins) echo "<img style='position: absolute; margin: 14px 10px 0px 100px;'src='images/article.png'><h5>Opis dodano poprawnie<h5><br><a href='?ids=o_firmie'><h5>Powrót</h5></a>";
  28.  
  29. else echo "<h5>Błąd! Nie udało dodać się opisu.</h5>";
  30.  
  31. } else echo "".$obrazek."<h5>Uzupełnij wszystkie pola<h5><br><a href='java script:history.back()'><h5>Powrót</h5></a>";
  32.  
  33. ?>
  34. <?php else: ?>
  35.  
  36. <div id="haslo">
  37.  
  38. <img style="position: absolute; margin: -5px 0px 0px -25px;"src="images/pencil.png"><p>O Mnie.</p><br>
  39.  
  40. <div class="box">
  41.  
  42. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" name="firma" accept-charset="utf-8">
  43.  
  44. <input type="submit" name="submit" class="pisz" value="">
  45. <input type="reset" name="reset" class="reset" value="">
  46.  
  47. Opis:<br>
  48. <textarea name="tresc" tabindex="1" title="Opis..." ></textarea><br><br><br><br>
  49.  
  50. </form>
  51.  
  52. </div>
  53. </div>
  54.  
  55. <?php endif; ?>

Ktoś wie co jest grane (IMG:style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Closed TopicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 17.09.2025 - 13:06