Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Skrypt podstron
-fatleg-
post
Post #1





Goście







Witam, po niżej znajduje się kod (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) jak widać nie jest on zbyt bezpieczny (IMG:http://forum.php.pl/style_emoticons/default/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']); ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nazihipi
post
Post #2





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 14.07.2006

Ostrzeżenie: (10%)
X----


  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. ?>


Ten post edytował nazihipi 21.08.2006, 20:10:51
Go to the top of the page
+Quote Post

Posty w temacie
- fatleg   Skrypt podstron   21.08.2006, 19:57:55
- - nazihipi   [PHP] pobierz, plaintext <?php $strAction = 'm...   21.08.2006, 20:08:42
- - Gość   A tam na dole ? w divie   21.08.2006, 20:11:23
- - Gość   O sorry, nie zaczaiłem kodu ;p   21.08.2006, 20:18:49
- - nazihipi   [PHP] pobierz, plaintext <?php function setPag...   21.08.2006, 20:29:16


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.09.2025 - 15:15