Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Skrypt podstron
Forum PHP.pl > Forum > Przedszkole
fatleg
Witam, po niżej znajduje się kod smile.gif jak widać nie jest on zbyt bezpieczny rolleyes.gif ,
mam pytanie "Jak można go " ''ubezpieczyć'' "?

  1. <?php
  2.  
  3. function mineclude($url)
  4. {
  5. $getinup = 'dir/'.$url.'.php';
  6.  
  7. if(!isset($url))
  8. {
  9. $getinup = 'dir/main.php';
  10. }
  11.  
  12. if(file_exists($getinup))
  13. {
  14. include($getinup);
  15. }
  16. else
  17. {
  18. echo 'Bł&#261d! Sorry, Próba Nieautoryzowanego Wej&#347cia.';
  19. }
  20. }
  21. ?>
  22. ....... dalszy kod (html)
  23. <div class=tresc>
  24. <?php mineclude($_GET['dir']); ?>
nazihipi
  1. <?php
  2. $strAction = 'main';
  3. if( isset( $_GET['dir'] ) ) {
  4. $strAction = (string)strip_tags( $_GET['dir'] );
  5. }
  6. if( file_exist( 'dir/' . $strAction . '.php' ) ) {
  7. include( 'dir/' . $strAction . '.php' );
  8. }
  9. ?>
Gość
A tam na dole ? w divie
Gość
O sorry, nie zaczaiłem kodu ;p
nazihipi
  1. <?php
  2. function setPage() {
  3. $strAction = 'main';
  4. if( isset( $_GET['dir'] ) ) {
  5. $strAction = (string)strip_tags( $_GET['dir'] );
  6. }
  7. if( file_exist( 'dir/' . $strAction . '.php' ) ) {
  8. include( 'dir/' . $strAction . '.php' );
  9. }
  10. }
  11.  
  12. ?>


  1. ....... dalszy kod (html)
  2.  
  3. <div class=tresc>


  1. <?php setPage(); ?>


  1. </div>
  2. ....... dalszy kod (html)
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.