Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Skrypt podstron
-fatleg-
post 21.08.2006, 19:57:55
Post #1





Goście







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']); ?>
Go to the top of the page
+Quote Post
nazihipi
post 21.08.2006, 20:08:42
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
-Gość-
post 21.08.2006, 20:11:23
Post #3





Goście







A tam na dole ? w divie
Go to the top of the page
+Quote Post
-Gość-
post 21.08.2006, 20:18:49
Post #4





Goście







O sorry, nie zaczaiłem kodu ;p
Go to the top of the page
+Quote Post
nazihipi
post 21.08.2006, 20:29:16
Post #5





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

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


  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)


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

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

 



RSS Wersja Lo-Fi Aktualny czas: 20.07.2025 - 08:21