Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> 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
 
Start new topic
Odpowiedzi
-upf-
post
Post #2





Goście







Witam!
Dziękuję za odpowiedź, rzeczywiście był tam błąd. (IMG:http://forum.php.pl/style_emoticons/default/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

Posty w temacie
- upf   HTTP request failed!   19.03.2005, 13:41:48
- - hwao   ad1. string strstr ( string haystack, string needl...   19.03.2005, 14:17:24
- - upf   Witam! Dziękuję za odpowiedź, rzeczywiście był...   19.03.2005, 16:19:13
- - upf   Ok, problem rozwiązany. pozdrawiam mrKrecik   19.03.2005, 22:23:17


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: 28.12.2025 - 07:28