![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 6 Pomógł: 0 Dołączył: 14.01.2010 Ostrzeżenie: (0%) ![]() ![]() |
Witajcie jestem tutaj nowy. Postanowilem zaczac przygode z programowaniem w PHP
Szukalem na forum rozwiazania mojego problemu znalazlem kila podobnych sorzystalem ze wszystkich ale nic mi ta nie dalo ![]() mam taki link: <a href=\"index.php?page=registration&".SESID."\">rejestruj</a>\n"; Gdy klikne w ten link przegladarka laduje jakas strone ale wyswietla spowrotem strone główna. Prosze powiedcie mi gdzie lezy problem i co jest nie tak. Ccialbym jeszcze dodac ze po kliknieci w likn adres w pasku adresu przegladarki zmienia sie. Oto link do strony w celu zobrazoeania : http://www.rdx.cba.pl Ten post edytował kokoszpl 14.01.2010, 20:53:37 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 6 Pomógł: 0 Dołączył: 14.01.2010 Ostrzeżenie: (0%) ![]() ![]() |
index.php
Kod <? ob_start(); include "session.php"; ?> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <title> ..:: Logowanie na stronie www ::.. </title> </head> <body> <table border=1 width=100%> <!-- naglowek --> <tr><td colspan=2> <h1>Moja strona www</h1> </td></tr> <!-- koniec --> <!-- lewa strona --> <tr><td width=25% height=450 valign=top> <? include "left.php"; ?> </td> <!-- koniec --> <!-- prawa strona --> <td valign=top> <? if($page=="") $page="link1"; if(!file_exists($page.".php")) { include "default.php"; } else { include_once $page.".php"; } ob_start(); ?> </td></tr> <!-- koniec --> </table> <!-- stopka --> <center><small>Wykonał Mariusz Kacki, e-mail: <a href="mailto:robokator@wp.pl">robokator@wp.pl</a></small></center> <!-- koniec --> </body> </html> left.php Kod <table border=1 width=100%> <tr><th align=center> ..:: System logowania ::.. </th></tr> <tr><td align=left> <? if(!auth()) { include "login.frm"; print "» <a href=\"index.php?page=registration&".SESID."\">Nowe konto</a>\n"; } else { print "» <a href=\"index.php?page=logout&".SESID."\">Wyloguj [" . $_SESSION["USER_LOGIN"] . "]</a>"; } ?> </td></tr> <tr><th align=center> ..:: Menu ::.. </th></tr> <tr><td align=left> » <a href="index.php?page=link1&<?=SESID?>">link 1</a><br> » <a href="index.php?page=link2&<?=SESID?>">link 2</a><br> </td></tr> </table> login.php Kod <table border=1 width=100%> <tr><th align=center> ..:: System logowania ::.. </th></tr> </table> <? if(!auth()) { print "<p class=error align=center>Złe hasło lub login.</p>"; } else { print "<p class=ok align=center>Witaj {$_SESSION["USER_LOGIN"]}, udało się Tobie poprawnie zalogować.</p>"; } ?> registration.php Kod <table border=1 width=100%> <tr><th align=center> ..:: Rejestracja ::.. </th></tr> </table> <? $result = False; if (isset($_POST['submit'])) { if(!$login || !$passwd) { echo "<p class=error align=center>Wszystkie pola są obowiązkowe.</p>\n"; } elseif(!eregi("^[_[:alnum:]-]{1,10}$",$login)) { echo "<p class=error align=center>Nieprawidłowy login.</p>\n"; } elseif(!eregi("^[_[:alnum:]-]{3,10}$",$passwd)) { echo "<p class=error align=center>Niepoprawne hasło.</p>\n"; } elseif(user_exists($login)) { echo "<p class=error align=center>Login \"$login\" jest już zajęty.</p>\n"; } else { $result = True; // formatuje wprowadzone dane $login = strtolower($login); add_user($login, md5($passwd)); // informacjie o nowym koncie echo "<p class=ok align=center>Konto zostało utworzone.</p>\n"; echo "Jeśli zapomnisz hasło to koniec :-), wszystkie hasła są kodowane. "; echo "Możesz teraz się zalogować i przetestować konto."; } } if(!$result) { // usówa tagi html z formularza $login = htmlentities(substr($_POST["login"], 0, 255)); include "registration.frm"; } ?> sesion.php Kod <? # start sesji session_start(); # biblioteka z funkcjiami include "func.php"; # logowanie, wylogowanie itp switch ($page) { case "login" : $login = htmlentities(substr($_POST["login"], 0, 255)); $passwd = htmlentities(substr($_POST["passwd"], 0, 255)); login($login, md5($passwd)); break; case "logout" : logout(); break; } ?> gdzie mam wstawic $_GET['page'] Ten post edytował kokoszpl 14.01.2010, 22:03:23 |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 18:44 |