![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 20 Pomógł: 0 Dołączył: 16.09.2010 Ostrzeżenie: (0%) ![]() ![]() |
Witam niestety o php nie mam zadnego pojecia a na stronie musze miec logowanie. Znalazlem gotowe rozwiazanie z rejestracja uzytkownika i z logowaniem. Strone z rejestracja udalo mi sie zrobic i dziala bez zarzuyu natomiast jesli chodzi o logowanie to pojawily sie problemy. Mianowicie jesli robie samo logowanie to wszystko dziala kod strony z logowaniem to:
<?php function checkPass($user, $pass) { $login = $_POST['login']; if(!$fd = @fopen("users/$login.cl50cp1eoq9zj3scotij1a84", "r")) return 1; $result = 2; while (!feof($fd)){ $line = trim(fgets($fd)); $arr = explode(":", $line); if(count($arr)<2) continue; if($arr[0] != $user) continue; if($arr[1] == $pass){ $result = 0; break; } else break; } fclose($fd); return $result; } session_start(); if(isSet($_SESSION['zalogowany'])){ header("Location:chronionastrona.php"); } else if(!isSet($_POST["haslo"]) || !isSet($_POST["login"])){ $_SESSION['komunikat'] = "Wprowadz nazwe uzytkownika i haslo:"; include('form.php'); } else{ $val = checkPass($_POST["login"], $_POST["haslo"]); if($val == 0){ $_SESSION['zalogowany'] = $_POST['login']; header("Location:chronionastrona.php"); } else if($val == 1){ $_SESSION['komunikat'] = "Blad serwera. Zalogowanie nie bylo mozliwe!"; include('form.php'); } else if($val == 2){ $_SESSION['komunikat'] = "Nieprawidlowa nazwa uzytkownika lub haslo"; include('form.php'); } else { $_SESSION['komunikat'] = "Blad serwera. Zalogowanie nie bylo mozliwe"; include('form.php'); } } ?> Ale jak wstawie te logowanie do gotowej strony html to zaczynaja sie juz problemy. Stronka na ktorej chce zamiescic logowanie ma kod: <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>PokerMoney.com Poker Blogs Coming Soon!</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="content-style-type" content="text/css" /> <meta name="generator" content="editplus" /> <meta name="author" content="PokerMoney.com Freeroll Poker Tournaments" /> <meta name="keywords" content="poker freerolls online poker freeroll tournaments freeroll schedule" /> <meta name="description" content="Freeroll tounaments offered by the popular online poker rooms" /> <link rel="stylesheet" href="stylesheet.css" tppabs="http://www.pokermoney.com/resources/stylesheet.css" type="text/css" /> </head> <body> <div id="body_bg"> <div id="container"> <div id="header"> <h1><span>Poker Freerolls</span></h1> <div id="navbar"> <a href="index.htm" tppabs="http://www.pokermoney.com/" title="Homepage">Home</a> · <a href="java script:if(confirm('http://www.onlinegambling.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.onlinegambling.com/'" tppabs="http://www.onlinegambling.com/">Online Gambling</a> · <a href="java script:if(confirm('http://www.uk-bingo.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.uk-bingo.com/'" tppabs="http://www.uk-bingo.com/">UK Bingo</a> · <a href="register.htm" tppabs="register.htm" title="Homepage">Register</a> · <a href="login.htm" tppabs="login.htm" title="Homepage">Login</a> </div> <table border="0" cellspacing="0" cellpadding="0" id="navigation"> <tr> <td class="redbuttonleft"> </td> <td class="navlink"><a href="index.htm" tppabs="http://www.pokermoney.com/" title="Homepage">HOME</a></td> <td class="redbuttonright"> </td> <td class="redbuttonleft"> </td> <td class="navlink"><a href="index-1.htm" tppabs="http://www.pokermoney.com/bankrolls/index.htm" title="Free Bankrolls">FREE BANKROLLS</a></td> <td class="redbuttonright"> </td> <td class="redbuttonleft"> </td> <td class="navlink"><a href="index-2.htm" tppabs="http://www.pokermoney.com/roomreviews/index.htm" title="Room Reviews">ROOM REVIEWS</a></td> <td class="redbuttonright"> </td> <td class="redbuttonleft"> </td> <td class="navlink"><a href="index-3.htm" tppabs="http://www.pokermoney.com/bonusmoney/index.htm" title="Top Bonuses">TOP BONUSES</a></td> <td class="redbuttonright"> </td> <td class="redbuttonleft"> </td> <td class="navlink"><a href="index-4.htm" tppabs="http://www.pokermoney.com/earn/index.htm" title="Earn Poker Money">EARN POKER MONEY</a></td> <td class="redbuttonright"> </td> <td class="redbuttonleft"> </td> <td class="navlink"><a href="index-5.htm" tppabs="http://www.pokermoney.com/tournaments/index.htm" title="Tournaments">TOURNAMENTS</a></td> <td class="redbuttonright"> </td> <td class="currentpageleft"> </td> <td class="currentpage"><a href="index-6.htm" tppabs="http://www.pokermoney.com/freeroll/index.htm" title="Freerolls">FREEROLLS</a></td> <td class="currentpageright"> </td> </tr> </table> </div> <div id="leaderboard"> <a href="java script:if(confirm('http://www.bodoglife.com/betting-offers/poker-com.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.bodoglife.com/betting-offers/poker-com.html'" tppabs="http://www.bodoglife.com/betting-offers/poker-com.html" rel="nofollow" target="_blank"> <img src="index-9.htm" tppabs="http://www.bodogaffiliatelife.com/sources/banners/poker/horizontal/728x90/728x90d-poker.gif" alt="Play Hard with 110% Bonus" width="728" height="90" border="0"> </a> </div> <div id="content_wide"> <div class="inner"> <h2 class="headerh2">xxx</h2> <p> <strong></strong> </p> <p> </p> </div> </div> <div id="rightcolumn"> <h2><span>Poker Rooms</span></h2> <div class="pokerlogo"> <a href="goldencasino.htm" tppabs="http://www.pokermoney.com/roomreviews/goldencasino.htm" title="Golden Casino"><img src="goldencasin_tnlogo.gif" tppabs="http://www.pokermoney.com/resources/images/goldencasin_tnlogo.gif" width="90" height="45" alt="Golden Casino" /></a> </div> <p> <img src="redarrow.gif" tppabs="http://www.pokermoney.com/resources/images/redarrow.gif" width="8" height="9" alt="Red Arrow" /> <a href="goldencasino.htm" tppabs="http://www.pokermoney.com/roomreviews/goldencasino.htm" title="Golden Casino">Golden Casino</a><br /> 100% on your 1st deposit. </p> <hr /> <div class="pokerlogo"> <a href="purplelounge.htm" tppabs="http://www.pokermoney.com/roomreviews/purplelounge.htm" title="Purple Lounge"><img src="purplelounge_tnlogo.gif" tppabs="http://www.pokermoney.com/resources/images/purplelounge_tnlogo.gif" width="126" height="60" alt="Purple Lounge Poker Room" /></a> </div> <p> <img src="redarrow.gif" tppabs="http://www.pokermoney.com/resources/images/redarrow.gif" width="8" height="9" alt="Red Arrow" /> <a href="purplelounge.htm" tppabs="http://www.pokermoney.com/roomreviews/purplelounge.htm" title="Purple Lounge Poker Room">Purple Lounge</a><br /> Supplies a $1000 Match Deposit Bonus! </p> <hr /> </div> <div id="footer"> <p> <a href="index-1.htm" tppabs="http://www.pokermoney.com/bankrolls/index.htm" title="Free Bankrolls">Free Bankrolls</a> · <a href="java script:if(confirm('http://www.pokermoney.com/rakeback/index.htm \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found. \n\nDo you want to open it from the server?'))window.location='http://www.pokermoney.com/rakeback/index.htm'" tppabs="http://www.pokermoney.com/rakeback/index.htm" title="Rakeback">Rakeback</a> · <a href="index-2.htm" tppabs="http://www.pokermoney.com/roomreviews/index.htm" title="Room Reviews">Room Reviews</a> · <a href="index-3.htm" tppabs="http://www.pokermoney.com/bonusmoney/index.htm" title="Bonuses">Bonuses</a> · <a href="index-4.htm" tppabs="http://www.pokermoney.com/earn/index.htm" title="Earn Poker Money">Earn Poker Money</a> · <a href="index-5.htm" tppabs="http://www.pokermoney.com/tournaments/index.htm" title="Tournaments">Tournaments</a> · <a href="index-6.htm" tppabs="http://www.pokermoney.com/freeroll/index.htm" title="Freerolls">Freerolls</a> · <a href="index-8.htm" tppabs="http://www.pokermoney.com/blogs/index.htm" title="Poker Blogs">Poker Blogs</a> </p> <div id="footerinfo"> <img src="pmfooter.bmp" tppabs="pmfooter.bmp" width="54px" height="21px" alt="PokerMoney.com Logo" /> <p> <a href="index.htm" tppabs="http://www.pokermoney.com/" title="Homepage">Home</a> | <a href="#" title="Terms & Conditions">Terms & Conditions</a> | <a href="#" title="Online Poker Directory">Poker Directory</a> | <a href="contact.htm" tppabs="http://www.pokermoney.com/contact.htm" title="Contact Us">Contact Us</a><br /> Copyright © 2009-2010 GetPokerCash.eu. All rights reserved. </p> </div> </div> </div> </div> </body> </html> Mozecie mi powiedziec co mam zmienic w kodzie zeby jak wstawie php do kodu html nie wyskakiwaly mi problemy > obecny kod wyglada nastepujaco: www.topdach.szczecin.pl/1/login.php Ten post edytował kamke4 16.09.2010, 13:48:24 |
|
|
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 36 557 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
1) Nie krzycz - nikt tu głuchy nie jest. Popraw tytuł na niekrzyczący
2) Uzywaj bbcode. Popraw post o bbcode. -------------------- "Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista "Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer |
|
|
![]()
Post
#3
|
|
![]() Grupa: Zarejestrowani Postów: 207 Pomógł: 17 Dołączył: 4.08.2009 Ostrzeżenie: (0%) ![]() ![]() |
session_start(); musi być od razu po otwarciu znacznika <?php.
|
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 20 Pomógł: 0 Dołączył: 16.09.2010 Ostrzeżenie: (0%) ![]() ![]() |
session_start(); musi być od razu po otwarciu znacznika <?php. hmmm zrobilem cos takiego <?php session_start(); if(isSet($_SESSION['zalogowany'])){ header("Location:chronionastrona.php"); } else if(!isSet($_POST["haslo"]) || !isSet($_POST["login"])){ $_SESSION['komunikat'] = "Wprowadz nazwe uzytkownika i haslo:"; include('form.php'); } else{ $val = checkPass($_POST["login"], $_POST["haslo"]); if($val == 0){ $_SESSION['zalogowany'] = $_POST['login']; header("Location:chronionastrona.php"); } else if($val == 1){ $_SESSION['komunikat'] = "Blad serwera. Zalogowanie nie bylo mozliwe!"; include('form.php'); } else if($val == 2){ $_SESSION['komunikat'] = "Nieprawidlowa nazwa uzytkownika lub haslo"; include('form.php'); } else { $_SESSION['komunikat'] = "Blad serwera. Zalogowanie nie bylo mozliwe"; include('form.php'); } } function checkPass($user, $pass) { $login = $_POST['login']; if(!$fd = @fopen("users/$login.cl50cp1eoq9zj3scotij1a84", "r")) return 1; $result = 2; while (!feof($fd)){ $line = trim(fgets($fd)); $arr = explode(":", $line); if(count($arr)<2) continue; if($arr[0] != $user) continue; if($arr[1] == $pass){ $result = 0; break; } else break; } fclose($fd); return $result; } ?> i dalej bledy ![]() |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 65 Pomógł: 5 Dołączył: 10.09.2010 Ostrzeżenie: (0%) ![]() ![]() |
Cytat Ale jak wstawie te logowanie do gotowej strony html to zaczynaja sie juz problemy. Jakie problemy ? I jeszcze, uzywaj BBcode.. A jak piszesz skrypty rob wciecia... Ten post edytował naitsabes 16.09.2010, 13:49:42 |
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 20 Pomógł: 0 Dołączył: 16.09.2010 Ostrzeżenie: (0%) ![]() ![]() |
http://www.topdach.szczecin.pl/1/login.php
to jest strona z logowaniem zobacz jaki blad mi wyskakuje. Niestety nie mam pojecia co to sa wciecia ... nigdy stycznosci z php nie mialem poprostu musze na stronie zrobic logowanie no i jest problem ![]() help ! HELP ! |
|
|
![]()
Post
#7
|
|
![]() Grupa: Moderatorzy Postów: 36 557 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
1) Kilka refreshy tematu na dzien to lekka przesada
2) help, help.... polskiego nie zna? 3) Prosilem o poprawienie bbcode 1+2+3 = 4 = zamykam jak wyrazisz ochotę dostosowanie się do bbcode i przestania odswiezania tematu i pisania po polsku to odblokuje. -------------------- "Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista "Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 18.07.2025 - 00:44 |