Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> fsockopen kilka pytan
Apo
post
Post #1





Grupa: Zarejestrowani
Postów: 426
Pomógł: 1
Dołączył: 2.10.2005

Ostrzeżenie: (0%)
-----


Witam
Chciałem przy pomocy fsockopen wejsc na strone i zeby zamiast $_SERVER['REMOTE_ADDR'] by tam dowolny text. Więc napisalem:
  1. <?php
  2. if(!$f=fsockopen('localhost', 80))
  3. {
  4. echo 'error';
  5. } else {
  6.  
  7. $get = "GET /bot/ip.php HTTP/1.0\r\n"; 
  8. $get .= "Host: localhost\r\n"; 
  9. $get .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)\r\n";
  10. $get .= "Pragma: no-cache\r\n";
  11. $get .= "REMOTE_ADDR: lol\r\n";
  12. fputs($f, $get);
  13. fclose($f);
  14. }
  15. ?>

Ale cos mi to nie wyszło :/ Jeśli moglibyście mnie poprawic i dac jakis link do opisów nagłówków albo coś podobnego.

EDIT SORRY NIE TEN DZIAL

~FiDO: juz przeniesiony

Ten post edytował FiDO 14.03.2006, 21:09:04
Go to the top of the page
+Quote Post
hwao
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




ale php pro laugh.gif (sorka nie moglem Rkingsmiley.png ) smile.gif

http://repository.hwao.be/subdomains/repos...quest.class.php

Popatrz sobie i dopisz tylko naglowek refera (nie pamietam czy go wdrazalem w aplikacji... smile.gif )
Go to the top of the page
+Quote Post
sobstel
post
Post #3





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

Ostrzeżenie: (0%)
-----


czy ja cos zle zrozumialem czy tez probujesz przeslac adres ip w naglowkach??


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
Apo
post
Post #4





Grupa: Zarejestrowani
Postów: 426
Pomógł: 1
Dołączył: 2.10.2005

Ostrzeżenie: (0%)
-----


Cytat
czy ja cos zle zrozumialem czy tez probujesz przeslac adres ip w naglowkach??

dobrze zrozumiales smile.gif
@hwao topic przez przypadek założyłem w php pro
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #5





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

Ostrzeżenie: (0%)
-----


Cytat
dobrze zrozumiales smile.gif

w zasadzie to LOL, tego nie zmienisz, to pakiet TCP/IP zawiera adres skad nadszedl request.
Wyobraz sobie ze wysylasz rzadanie o obraz plyty DVD i podajesz adres IP kumpla, serwer wysyla obraz plyty na IP kumpla czym zapycha mu lacze na tydzien smile.gif


--------------------
Nie lubię jednorożców.
Go to the top of the page
+Quote Post
sobstel
post
Post #6





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

Ostrzeżenie: (0%)
-----


na przyszlosc polecam poczytac specyfikacje HTTP, zwlaszcza naglowki jakie moga wchodzic w sklad żądania i odpowiedzi.


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
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 Aktualny czas: 20.08.2025 - 10:07