Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]file_get_contents problem z &
wnovak
post
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 24.04.2005

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


  1. file_get_contents("http://www.allegro.pl/search.php?us_id=1111111&string=xxxxx");

Mam problem, jak dam w adresie & to mi zwraca:
  1. Warning: file_get_contents() [function.file-get-contents]: Circular redirect, aborting.
  2. Warning: file_get_contents(http://www.allegro.pl/search.php?us_id=11111&string=xxxxx) [function.file-get-contents]: failed to open stream: Success in


a jak użyje & to wtedy pobiera stronę z uwzględnieniem tylko pierwszej zmiennej.

Nie mogę znaleźć rozwiązania, próbowałem między innymi urlencode()
Go to the top of the page
+Quote Post
pedro84
post
Post #2





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Spróbuj zamienić ampersand na %26 (ampersand w ASCII), może pomóc, może nie, ale taka pierwsza myśl.

Ten post edytował pedro84 23.04.2010, 13:25:49
Go to the top of the page
+Quote Post
wnovak
post
Post #3





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 24.04.2005

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


już próbowałem, też nic nie pomaga, również ten kod przepuszczony przez urldecode()
Go to the top of the page
+Quote Post
batman
post
Post #4





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




To nie jest wina &. W Twoim przypadku problemem jest nieskończona pętla (Circular redirect, aborting.) Najwyraźniej Allegro nie pozwala na takie praktyki.
Jak to obejść? Skorzystaj z Web API Allegro lub kombinuj z nagłówkami. Domyślam się, że chodzi o User-Agent.
Go to the top of the page
+Quote Post
wnovak
post
Post #5





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 24.04.2005

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


ok, dzięki zobaczę czy się uda (IMG:style_emoticons/default/snitch.gif)
Go to the top of the page
+Quote Post

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: 23.09.2025 - 15:03