Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Parse error: syntax error, unexpected $end in /virtual/b/l/bluebunny.pl-probnablubunny/rejestracja.php on line 102, wtf?
n0dve
post
Post #1





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

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


Witam. Po raz 1 spotykam się z PHP. Mam do Was małe pytanie? Co to jest... Wyskakuje mi taki błąd jak kliknę na stronie zarejestruj się: Parse error: syntax error, unexpected $end in /virtual/b/l/bluebunny.pl-probnablubunny/rejestracja.php on line 102

Mam oto taki kod php. rejestracja.php:
Kod
    <?php
    
    session_start(); // rozpoczęcie sesji
    if (!isset($_SESSION['login']))  // dostęp dla zalogowanego użytkownika
    
        include 'db.php'; // połączenie się z bazą danych
    require_once('recaptchalib.php'); // dołączenie modułu reCAPTCHA
        $privatekey = '856987'; // prywatny klucz reCAPTCHA
        $publickey = '548964'; // publiczny klucz reCAPTCHA

        if ($_POST["wyslane"]) { // jeżeli formularz został wysłany, to wykonuje się poniższy skrypt
    
        // filtrowanie treści wprowadzonych przez użytkownika
        $login = htmlspecialchars(stripslashes(strip_tags(trim($_POST["login"]))), ENT_QUOTES);
        $haslo = $_POST["haslo"];
            $haslo2 = $_POST["haslo2"];
        $email = htmlspecialchars(stripslashes(strip_tags(trim($_POST["email"]))), ENT_QUOTES);
        $email2 = htmlspecialchars(stripslashes(strip_tags(trim($_POST["email2"]))), ENT_QUOTES);
            $imie = htmlspecialchars(addslashes(strip_tags(trim($_POST["imie"]))), ENT_QUOTES);
        $nazwisko = htmlspecialchars(addslashes(strip_tags(trim($_POST["nazwisko"]))), ENT_QUOTES);
            $resp = recaptcha_check_answer ($privatekey,
                    $_SERVER["REMOTE_ADDR"],
                $_POST["recaptcha_challenge_field"],
                    $_POST["recaptcha_response_field"]);
    
        // system sprawdza czy prawidło zostały wprowadzone dane
            if (strlen($login) < 3 or strlen($login) > 30 or !eregi("^[a-zA-Z0-9_.]+$", $login)) {
            $blad++;
                echo '<p>Proszę poprawny wprowadzić login (od 3 do 30 znaków).</p>';
        } else {
                $wynik = mysql_query("SELECT * FROM $tabela WHERE login='$login'");
            if (mysql_num_rows($wynik) <> 0) {
                    $blad++;
                echo '<p>Podana nazwa użytkownika została już zajęta.</p>';
            }
            }
        if (strlen($haslo) < 6 or strlen($haslo) > 30 ) {
            $blad++;
                echo '<p>Proszę poprawnie wpisać hasło (od 6 znaków do 30 znaków). </p>';
            }
        if ($haslo !== $haslo2) {
            $blad++;
                echo '<p> Podane hasła nie są ze sobą zgodne. </p>';
        }
            if (!eregi("^[0-9a-z_.-]+@([0-9a-z-]+.)+[a-z]{2,4}$", $email)) {
                $blad++;
                echo '<p> Proszę wprowadzić poprawnie adres email.</p>';
            } else {
                $wynik = mysql_query("SELECT * FROM $tabela WHERE email='$email'");
            if (mysql_num_rows($wynik) <> 0) {
                $blad++;
                    echo '<p> Podany adres e-mail jest już zajęty.</p>';
                }
        }
        if ($email !== $email2) {
                $blad++;
                echo '<p> Podane adresy e-mail nie są ze sobą zgodne.</p>';
            }
        if (!$resp->is_valid) {
            echo '<p>Proszę wpisać poprawnie wyrazy z obrazka.</p>';
                $blad++;

            // jeżeli nie ma żadnego błedu, użytkownik zostaje zarejestronwany i wysłany do niego e-mail z linkiem aktywacyjnym
        if ($blad == 0)
    
                $haslo = md5($haslo); // zaszyfrowanie hasla
            $kod = uniqid(rand()); // tworzenie unikalnego kodu dla użytkownika

            $wynik = mysql_query("INSERT INTO $tabela VALUES('', '$imie', '$nazwisko', '$login', '$haslo', '$email', '$kod', NOW(), '')");
                if ($wynik) {
                $list = "Witaj $login !
                Kliknij w poniższy link, aby aktywować swoje konto. http://www.twoja-strona.pl/weryfikacja.php?weryfikacja=potwierdz&kod=$kod";
                mail($email, "Rejestracja użytkownika", $list, "From: <kontakt@twoja-strona.pl>");
                echo '<p>Dziękujemy za rejestrację! W ciągu nabliższych 5 minut dostaniesz wiadomość e-mail z dalszymi wskazówkami rejestracji.</p>';
                mysql_close($polaczenie);
                exit;
                }
        // tworzenie formularza HTML
        echo <<< KONIEC
    
        <form action="rejestracja.php" method="post">
        <input type="hidden" name="wyslane" value="TRUE" />
    
        <p>Imię: <input type="text" name="imie" /></p>
        <p>Nazwisko: <input type="text" name="nazwisko" /></p>
    <p>Login*: <input type="text" name="login" /></p>
        <p>Hasło*: <input type="password" name="haslo" /></p>
        <p>Powtórz hasło*: <input type="password" name="haslo2" /></p>
        <p>Adres e-mail*: <input type="text" name="email" /></p>
        <p>Powtórz adres e-mail*: <input type="text" name="email2" /></p>
    KONIEC;
        echo recaptcha_get_html($publickey); // wyświetlanie reCAPTCHA
    echo <<< KONIEC
        <p><input type="submit" value="wyślij" /></p></form>
    KONIEC;
    } else {
        header('Location: / '); // zalogowany użytkownik zostaje przekierowany na stronę główną
    }
    
    ?>php


oraz indeks: post poniżej




Proszę o analizę tych kodów i powiedzenie co jest nie tak...

oczywiście plik db.php potrzebny do połączenia z bazą jest poprawnie wypełniony.


Bardzo proszę o pomoc i z góry dziękuje ;]

Kod
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<?
include("_mysql.php");
include("_settings.php");
include("_functions.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title><? echo PAGETITLE; ?></title>
<link href="_stylesheet.css" rel="stylesheet" type="text/css">
<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
<script type="text/javascript" src="lightbox.js"></script>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    
    <script type="text/javascript">
    function menu(co)

        {
            var menu = new Array();
            menu[0] = "<a href=\"index.php?site=news\">Strona Glowna</a> &nbsp; <a href=\"index.php?site=articles\">Atrykuly</a> &nbsp; <a href=\"index.php?site=clanwars\">Wyniki</a> &nbsp; <a href=\"index.php?site=calendar\">Kalendarz</a> &nbsp; <a href=\"index.php?site=about\">O nas</a> &nbsp; <a href=\"index.php?site=history\">Historia</a> &nbsp; <a href=\"index.php?site=awards\">Osiagniecia</a>";
            menu[1] = "<a href=\"index.php?site=squads&action=show&squadID=1\">Organizacja</a> &nbsp; <a href=\"index.php?site=squads&action=show&squadID=2\">Counter-Strike 1.6</a> &nbsp; <a href=\"index.php?site=squads&action=show&squadID=3\">Cod 2 (1.0)</a> &nbsp; <a href=\"index.php?site=squads&action=show&squadID=4\">Cod 2 (1.3)</a> &nbsp; <a href=\"index.php?site=squads&action=show&squadID=5\">Cod 4</a> &nbsp; <a href=\"index.php?site=members\">Wszystkie</a>";
            menu[4] = "<a href=\"index.php?site=files\">Pliki</a> &nbsp; <a href=\"index.php?site=demos\">Dema</a> &nbsp; <a href=\"index.php?site=links\">Linki</a> &nbsp; <a href=\"index.php?site=gallery\">Galeria</a>";
            document.getElementById("menu_bottom").innerHTML = menu[co];
        }
    

    </script>
    </head>
<body bgcolor="#001d2e">
<table width="1000" border="0" cellpadding="0" cellspacing="0" align="center">
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_01.gif" border="0"</a></td>
<td width="348" height="35" valign="center" align="center" background="img/_02.gif" style="padding-left:0px; padding-right:0px; padding-bottom:0px; padding-top:0px">

                                  <? include("counter.php"); ?>
</td>
<td><img src="img/_03.gif" border="0"</a></td>

<td width="369" height="35" valign="center" align="center" background="img/_04.gif" style="padding-left:0px; padding-right:0px; padding-bottom:0px; padding-top:0px">
<a href="index.php?site=login"><u>ZALOGUJ!!</u></a> A jesli nie posiadasz jeszcze konta <a href="rejestracja.php?site=rejestracja"><u>ZAREJESTRUJ SIE!!</u></a>
</td>
<td><img src="img/_05.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_06.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_07.gif" border="0"</a></td>
<td><a href="#" onmouseover="menu(0);"><img src="img/_08.gif" border="0"></a></td>
<td><a href="#" onmouseover="menu(1);"><img src="img/_09.gif" border="0"></a></td>
<td><a href="#" onmouseover="menu(4);"><img src="img/_10.gif" border="0"></a></td>
<td><a href="index.php?site=forum"><img src="img/_11.gif" border="0"</a></td>
<td><a href="index.php?site=contact"><img src="img/_12.gif" border="0"</a></td>
<td><img src="img/_13.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_14.gif" border="0"</a></td>
<td width="195" height="31" valign="center" align="center" background="img/_15.gif" style="padding-left:0px; padding-right:0px; padding-bottom:0px; padding-top:0px">
                                  <? include("data.php"); ?>
</td>
<td><img src="img/_16.gif" border="0"</a></td>

<td width="580" height="31" valign="center" background="img/_17.gif" style="padding-left:0px; padding-right:0px; padding-bottom:0px; padding-top:0px">

<div id="menu_bottom"></div>
</td>
<td><img src="img/_18.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_19.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td width="781" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#293f4b">
<td width="14" height="100%" valign="top" background="img/_41.gif">
<table border="0" cellpadding="0" cellspacing="0"background="img/_41.gif">
<img src="img/_20.gif" border="0">
</table>
<td width="552" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td width="268" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_21.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_31.gif" border="0"</a></td>
<td><div id="container"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this rotator.</div>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
        var s1 = new SWFObject("imagerotator.swf","rotator","252","129","1");
        s1.addVariable("file","madrid.xml");
        s1.addVariable("width","252");
        s1.addVariable("height","129");
        s1.write("container");</script></td>
<td><img src="img/_33.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_42.gif" border="0"</a></td>
</table>
</table>
<td width="284" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_22.gif" border="0"</a></td>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td width="41" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="1.php" target="ramka"><img src="img/_28.gif" border="0"</a></td>
</tr>
<tr>
<td><a href="3.php" target="ramka"><img src="img/_36.gif" border="0"</a></td>
</tr>
<tr>
<td><a href="2.php" target="ramka"><img src="img/_37.gif" border="0"</a></td>
</tr>
</table>
<td width="238" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<td><iframe width="238" height="130" frameborder="0" name="ramka" src="1.php" scrolling=no vspace="0">
Tu napis lub odwołanie w przypadku gdy przeglądarka nie
obsługuje pływających ramek</iframe>
</td>
<td><img src="img/_30.gif" border="0"</a></td>
</table>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<td><img src="img/_43.gif" border="0"</a></td>
</table>
</table>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="img/_46.gif" border="0"</a></td>
</tr>


indeks niestety jest za długi więc w kolejnym poście dalsza część :"D

Kod
<tr>
<td background="img/_58.gif" width="552">
<?
if(!isset($site)) $site="news";
$invalide = array('/','/\/',':','.');
                                                $site = str_replace($invalide,' ',$site);
                                                if(!file_exists($site.".php")) $site = "news";
                                                include($site.".php");
                                                ?>
                                           </td>
</tr>


<tr>
<td><img src="img/_72.gif" border="0"</a></td>
</tr>
</table>
</table>
<td width="4" valign="top">
<table border="0" cellpadding="0" cellspacing="0">

</table>
<td width="211" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="img/_24.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63" valign="top" background="img/_35.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("poll.php"); ?>
</td>
</tr>
<tr>
<td><img src="img/_38.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63" valign="center" align="center" background="img/_45.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("sc_randompic.php"); ?>
</td>
</tr>
<tr>
<td><img src="img/_51.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63"  valign="center" align="center" background="img/_52.gif" style="padding-left:6px; padding-right:0px; padding-bottom:0px; padding-top:0px">

                                  <? include("shoutbox.php"); ?>
</td>
</tr>
<tr>
<td><img src="img/_54.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63" valign="top" background="img/_56.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("sc_files.php"); ?>
</td>
</tr>
<tr>
<td><img src="img/_59.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63"  valign="top" align="left" background="img/_61.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("TV.html"); ?>
</td>
</tr>
<tr>
<td><img src="img/_64.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63"  valign="center" align="center" background="img/_61.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("galeria.html"); ?>
</td>
</tr>
<tr>
<td><img src="img/_68.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63" valign="center" align="center" background="img/_69.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

<iframe width=174 height=189 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="HelloWorld/iflateng.htm" scrolling="no" frameborder="0">
</iframe>


<form name="demoForm">
<input type="hidden" name="dateField">
</form>
</td>
</tr>
<tr>
<td><img src="img/_70.gif" border="0"</a></td>
</tr>
<tr>
<td width="211" height="63"  valign="center" align="center" background="img/_71.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("serwer.html"); ?>
</td>
</tr>
<tr>
<td><img src="img/_73.gif" border="0"</a></td>
</tr>
</table>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="img/_75.gif" border="0"</a></td>
</tr>
</table>
</table>
<td width="7" height="100%" valign="top" background="img/_62.gif">
<table border="0" cellpadding="0" cellspacing="0"background="img/_62.gif">
<img src="img/_25.gif" border="0">
</table>
<td width="203" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="img/_26.gif" border="0"</a></td>
</tr>
<tr>
<td width="203" height="107"  valign="center" align="center" background="img/_34.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("sponsor_gl.html"); ?>
</td>
</tr>
<tr>
<td><img src="img/_44.gif" border="0"</a></td>
</tr>
<tr>
<td width="203" height="107"  valign="center" align="center" background="img/_48.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("sponsor.html"); ?>
</td>
</tr>
<tr>
<td><img src="img/_53.gif" border="0"</a></td>
</tr>
<tr>
<td width="203" height="107"  valign="center" align="center" background="img/_55.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("part_medialni.html"); ?>
</td>
</tr>
<tr>
<td><img src="img/_60.gif" border="0"</a></td>
</tr>
<tr>
<td width="203" height="107" valign="top" background="img/_63.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("partners.php"); ?>
</td>
</tr>
<tr>
<td><img src="img/_66.gif" border="0"</a></td>
</tr>
<tr>
<td width="203" height="300" valign="center" align="center" background="img/_67.gif" style="padding-left:6px; padding-right:3px; padding-bottom:0px; padding-top:0px">

                                  <? include("reklama.html"); ?>
</td>
</tr>
<tr>
<td><img src="img/_74.gif" border="0"</a></td>
</tr>
</table>
<td width="9" valign="top">
<table border="0" cellpadding="0" cellspacing="0">

</table>
</table>
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center" height="14">
</table>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="img/_78.gif" border="0"</a></td>
</tr>
</table>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
everth
post
Post #2





Grupa: Zarejestrowani
Postów: 782
Pomógł: 153
Dołączył: 21.07.2010

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


Przeczytaj sobie ten post, najlepiej cały temat. Naucz się stosować odpowiednie BBtagi do kodu, bo inaczej to w poście nic nie widać. I co właściwie robi to 'php' pod koniec pliku php?


--------------------
Już mi się ani wiedzieć, ani tym bardziej myśleć nie chce.
[Think different]!
Go to the top of the page
+Quote Post
thek
post
Post #3





Grupa: Moderatorzy
Postów: 4 362
Pomógł: 714
Dołączył: 12.02.2009
Skąd: Jak się położę tak leżę :D




To znaczy, że napotkano na koniec pliku, choć kod sugeruje, iż powinno coś być jeszcze. Zazwyczaj tak jest, gdy masz źle sparowane nawiasy, a konkretnie otwarłeś jakiś i nie zamknąłeś. Dlatego interpreter robi, robi i szuka tego zamykającego i nagle" "UPS... koniec pliku a zamknięcia brak" smile.gif

Poza tym... Użyj prawidłowego bbcode dla WŁAŚCIWEGO języka i nie wal do znacznika CODE wtedy :/


--------------------
Najpierw był manual... Jeśli tam nie zawarto słów mądrości to zapytaj wszechwiedzącego Google zadając mu własciwe pytania. A jeśli i on milczy to Twój problem nie istnieje :D
Go to the top of the page
+Quote Post
n0dve
post
Post #4





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

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


Czyli się pofatyguję i poszukam biggrin.gif

Jeżeli nie pomoże, napiszę. A i jeszcze jedno pytanie. Jak to mam dokładnie w indeksie podmienić? biggrin.gif
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 Aktualny czas: 22.08.2025 - 01:46