Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> HTTP request failed!
-upf-
post
Post #1





Goście







Witam!
Mam pewien problem. stosuje funkcję, która wygląda tak:

  1. <?php
  2.  
  3. function Spr($user){
  4.  if (strstr(file($user),$tekst)){ return True; }else{ return False; }
  5. }
  6.  
  7. ?>


Załużmy, że:
$user = 'http://onet.pl';
$tekst = 'Lepper';

Wszystko jest niby ok, ale gdy włączam stronę to wyskakuje błąd:

Kod
Warning: file(http://onet.pl ): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in c:\webserv\httpd\test.php on line 32


O co tutaj chodzi?

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




ad1.
string strstr ( string haystack, string needle)

u Ciebie to jest tablica...

ad2.
Blad jest dla tego ze nie mozesz otwierac plikow http:// (ustanione w php.ini w celach bezpieczenstwa)
Go to the top of the page
+Quote Post
-upf-
post
Post #3





Goście







Witam!
Dziękuję za odpowiedź, rzeczywiście był tam błąd. winksmiley.jpg
Ale teraz mam inny problem, otóż nie potrafię przeczytać zawartości podanej strony.

  1. <?php
  2.  
  3. $plik = fopen(&#092;"http://onet.pl\", \"r\");
  4. $t = fgets($plik, &#092;"10\");
  5. echo $t;
  6.  
  7. ?>


Występuję błąd typu:

Kod
Warning: fgets(): supplied argument is not a valid stream resource in c:\webserv\httpd\test.php on line 46


pozdr.
Go to the top of the page
+Quote Post
upf
post
Post #4





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 19.03.2005

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


Ok, problem rozwiązany. smile.gif

pozdrawiam
mrKrecik
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:44