![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 8 Pomógł: 0 Dołączył: 7.04.2010 Ostrzeżenie: (0%) ![]() ![]() |
Witam
w php nie jestem nawet początkujący ale chciałbym sobie ułatwić trochę pracę na moich stronach:) Otóż mam kod z systemu wymiany linków i powiedzmy 100 stron na różnych domenach i kilku hostingach i chciałem się zabezpieczyć na wypadek bana lub innych ewentualności w których będę chciał zmienić SWL więc postanowiłem zrobić coś takiego:
Czy takie zastosowanie funkcji include jest bezpieczne? |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 1 568 Pomógł: 192 Dołączył: 7.03.2005 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Jak zadziała to tak.
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see List of Supported Protocols/Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script. -------------------- |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 72 Pomógł: 0 Dołączył: 8.12.2009 Ostrzeżenie: (0%) ![]() ![]() |
Jeśli includujesz plik ze swojego serwera to jest bezpieczne. Jeśli należy do kogoś innego to ktoś może dać skrypt w tym pliku i go wywołać, i dzięki niemu mieć dostęp do Twoich danych.
|
|
|
![]()
Post
#4
|
|
![]() Grupa: Zarejestrowani Postów: 317 Pomógł: 58 Dołączył: 6.11.2005 Ostrzeżenie: (0%) ![]() ![]() |
A żeby było to jeszcze bezpieczniejsze, to - o ile jest to Twój serwer - zamiast "plik.inc" nazywaj pliki np. "plik.inc.php" (chodzi o rozszerzenie). Dzięki temu nikt Ci nie podejrzy kodu, którego być może nie powinien widzieć.
-------------------- |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 8 Pomógł: 0 Dołączył: 7.04.2010 Ostrzeżenie: (0%) ![]() ![]() |
plik oczywiście bedzie na moim serwerze.
dzięki:) |
|
|
![]()
Post
#6
|
|
![]() Grupa: Zarejestrowani Postów: 2 592 Pomógł: 445 Dołączył: 12.03.2007 Ostrzeżenie: (0%) ![]() ![]() |
Jeśli ze swojego serwera to nie podawaj ścieżki z http, tylko według struktury plików na dysku
-------------------- |
|
|
![]()
Post
#7
|
|
Grupa: Zarejestrowani Postów: 8 Pomógł: 0 Dołączył: 7.04.2010 Ostrzeżenie: (0%) ![]() ![]() |
ale strony będą na różnych serwerach
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 20:36 |