Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: skrypt logowania
Forum PHP.pl > Forum > PHP
seedbox
Witam

Zwracam się do Was z ponowną prośbą o pomoc w skrypcie logowania. Znalazłem w sieci skrypt

Skrypt logowania

skrypt działa ok natomiast nie mogę sobie poradzić z zabezpieczeniem polków na stronie by nie można w nie wejść jeśli nie jesteś zalogowanym
Jeśli kroś by był wstanie mi pomuc w tym będę wdzięczny chyba że ktoś poczuje się na siłach i napisał by mi podobny skrypt odpłatnie
Pozdrawiam
Szymas
Sprawdź czy istnieje zmienna sesji na kolejnej podstronie(w tym przypadku index.php).
  1. if(isset($_SESSION['login'])
  2. {
  3. //Zawartość dostępna
  4. }
  5. else
  6. {
  7. echo 'Brak dostępu';
  8. }
seedbox
Zapomniałem dodac ze strona jest w html przyklad podstrony
to własnie tam chce dodać tą blokade


  1. <!DOCTYPE html>
  2. <title>AXN - M-CAST.GA</title>
  3.  
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5.  
  6. <link rel="stylesheet" href="http://cdn2.editmysite.com/css/sites.css?buildTime=1394840434" type="text/css" /><link rel='stylesheet' type='text/css' href='http://cdn1.editmysite.com/editor/libraries/fancybox/fancybox.css?1394840434' />
  7. <link rel='stylesheet' type='text/css' href='files/main_style.css?1395060490' title='wsite-theme-css' />
  8. <link href='http://fonts.googleapis.com/css?family=Ubuntu:400,300,300italic,700,400italic,700italic' rel='stylesheet' type='text/css' />
  9. <link href='http://fonts.googleapis.com/css?family=Arvo:400,700,400italic,700italic' rel='stylesheet' type='text/css' />
  10. <style type='text/css'>
  11. .wsite-elements.wsite-not-footer div.paragraph, .wsite-elements.wsite-not-footer p, .wsite-elements.wsite-not-footer .product-block .product-title, .wsite-elements.wsite-not-footer .product-description, .wsite-elements.wsite-not-footer .wsite-form-field label, .wsite-elements.wsite-not-footer .wsite-form-field label, #wsite-content div.paragraph, #wsite-content p, #wsite-content .product-block .product-title, #wsite-content .product-description, #wsite-content .wsite-form-field label, #wsite-content .wsite-form-field label, .blog-sidebar div.paragraph, .blog-sidebar p, .blog-sidebar .wsite-form-field label, .blog-sidebar .wsite-form-field label {font-family:"Arial" !important;}
  12. #wsite-content div.paragraph, #wsite-content p, #wsite-content .product-block .product-title, #wsite-content .product-description, #wsite-content .wsite-form-field label, #wsite-content .wsite-form-field label, .blog-sidebar div.paragraph, .blog-sidebar p, .blog-sidebar .wsite-form-field label, .blog-sidebar .wsite-form-field label {color:#d5d5d5 !important;}
  13. .wsite-elements.wsite-footer div.paragraph, .wsite-elements.wsite-footer p, .wsite-elements.wsite-footer .product-block .product-title, .wsite-elements.wsite-footer .product-description, .wsite-elements.wsite-footer .wsite-form-field label, .wsite-elements.wsite-footer .wsite-form-field label{}
  14. .wsite-elements.wsite-not-footer h2, .wsite-elements.wsite-not-footer .product-long .product-title, .wsite-elements.wsite-not-footer .product-large .product-title, .wsite-elements.wsite-not-footer .product-small .product-title, #wsite-content h2, #wsite-content .product-long .product-title, #wsite-content .product-large .product-title, #wsite-content .product-small .product-title, .blog-sidebar h2 {}
  15. #wsite-content h2, #wsite-content .product-long .product-title, #wsite-content .product-large .product-title, #wsite-content .product-small .product-title, .blog-sidebar h2 {}
  16. .wsite-elements.wsite-footer h2, .wsite-elements.wsite-footer .product-long .product-title, .wsite-elements.wsite-footer .product-large .product-title, .wsite-elements.wsite-footer .product-small .product-title{}
  17. #wsite-title {}
  18. .wsite-menu-default a {}
  19. .wsite-menu a {}
  20. .wsite-image div, .wsite-caption {}
  21. .galleryCaptionInnerText {}
  22. .fancybox-title {}
  23. .wslide-caption {}
  24. .wsite-phone {}
  25. .wsite-headline {}
  26. .wsite-headline-paragraph {}
  27. .wsite-button-inner {}
  28. .wsite-not-footer blockquote, #wsite-com-product-tab blockquote {}
  29. .wsite-footer blockquote {}
  30. .blog-header h2 a {}
  31. h2.wsite-product-title {}
  32. .wsite-product .wsite-product-price a {}
  33.  
  34. <script><!--
  35. var STATIC_BASE = '//cdn1.editmysite.com/';
  36. var STYLE_PREFIX = 'wsite';
  37. //-->
  38. <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
  39. <script src='http://cdn2.editmysite.com/js/site/main.js?buildTime=1394840434'></script>
  40. <script>_W.relinquish && _W.relinquish()</script>
  41. <script type='text/javascript'><!--
  42. var IS_ARCHIVE=1;
  43. (function(jQuery){
  44. function initFlyouts(){initPublishedFlyoutMenus([{"id":"401873332521988787","title":"Strona Gł&oacute;wna","url":"index.html","target":""},{"id":"132340274867480014","title":"Kontakt","url":"kontakt.html","target":""}],"133041731899793529","<li><a href='#'>{{title}}<\/a><\/li>",'',false)}
  45. if (jQuery) {
  46. if (jQuery.browser.msie && !window.flyoutMenusRefreshable) window.onload = initFlyouts;
  47. else jQuery(initFlyouts);
  48. }else{
  49. if (Prototype.Browser.IE) window.onload = initFlyouts;
  50. else document.observe('dom:loaded', initFlyouts);
  51. }
  52. })(window._W && _W.jQuery)
  53. //-->
  54. </script>
  55.  
  56. <script id="_wau92s">var _wau = _wau || []; _wau.push(["small", "m7zlhe2y6qks", "92s"]);
  57. (function() {var s=document.createElement("script"); s.async=true;
  58. s.src="http://widgets.amung.us/small.js";
  59. document.getElementsByTagName("head")[0].appendChild(s);
  60. })();</script>
  61. </head>
  62. <body class='splash-page wsite-background wsite-theme-light wsite-page-axn'>
  63. <div id="nav-wrap">
  64. <div class="container">
  65. <table id="header">
  66. <tr>
  67. <td id="logo"><span class='wsite-logo'><a href=''><span id="wsite-title">M-CAST.GA</span></a></span></td>
  68. <td id="nav"> <ul class='wsite-menu-default'><li id='active'><a href='index.html'>Strona Gł&oacute;wna</a></li><li id='pg500380637292923285'><a href='wspomoacute380-nas.html'>Wspom&oacute;ż Nas</a></li><li id='pg132340274867480014'><a href='kontakt.html'>Kontakt</a></li></ul> </td>
  69. <!--<td class="search">{search}</td>-->
  70. </tr>
  71. </table>
  72. </div><!-- end container -->
  73. </div><!-- end nav-wrap -->
  74.  
  75. <div id="splash-wrap">
  76. <div class="main-wrap">
  77. <div id="content-section">
  78. <div id='wsite-content' class='wsite-elements wsite-not-footer'>
  79. <div><div class="wsite-multicol"><div class='wsite-multicol-table-wrap' style='margin:0 -15px'>
  80. <table class='wsite-multicol-table'>
  81. <tbody class='wsite-multicol-tbody'>
  82. <tr class='wsite-multicol-tr'>
  83. <td class='wsite-multicol-col' style='width:15.957446808511%;padding:0 15px'>
  84.  
  85. <div style="text-align:left;"><div style="height: 10px; overflow: hidden;"></div>
  86. <a class="wsite-button wsite-button-small wsite-button-normal" href="index.html" >
  87. <span class="wsite-button-inner">&lt;WRĂÄ</span>
  88. </a>
  89. <div style="height: 10px; overflow: hidden;"></div></div>
  90.  
  91. </td>
  92. <td class='wsite-multicol-col' style='width:84.042553191489%;padding:0 15px'>
  93.  
  94. <div style="text-align:left;"><div style="height: 10px; overflow: hidden;"></div>
  95. <a class="wsite-button wsite-button-small wsite-button-normal" href="http://<a href="http://m-cast.ga/czat.php" onclick="java script:void window.open('http://m-cast.ga/czat.php','1395055546846','width=325,height=475,toolbar=0,menubar=0,location=0,status=1,scrollbars=0,resiza
    ble=1,left=0,top=1'
    );return false;"" >
  96. <span class="wsite-button-inner">CZAT</span>
  97. </a>
  98. <div style="height: 10px; overflow: hidden;"></div></div>
  99.  
  100. </td>
  101. </tr>
  102. </div></div></div>
  103.  
  104. <div><div id="750688769886282042" align="center" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"><script type="text/javascript"> id="21367"; ew="620"; eh="350";</script><script type="text/javascript" src="http://www.castalba.tv/js/embed.js"></script></div>
  105.  
  106.  
  107.  
  108. </div>
  109.  
  110. <div><div id="380229377832632801" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml">
  111. <script type="text/javascript" src="http://livecounter.theyosh.nl/4024.js"></script></div>
  112.  
  113.  
  114.  
  115. </div></div>
  116.  
  117. </div>
  118. </div>
  119. </div><!-- end splash-wrap -->
  120.  
  121. </body>
  122. </html>
Szymas
Z tego co mi wiadomo HTML'em skutecznie nic nie zablokujesz. Jeżeli używasz samego HTML'a to także skrypt logowania nie ma tu sensu. Jeżeli chcesz blokować dostęp dla niezalogowanych polecam przerobienie strony pod PHP.
Turson
Jak bardzo chcesz logowanie, to może zainteresuj się http://www.rabinek.pl/katalog-z-haslem/
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.