Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> curl gubi + (plus) przesylajac go postem
1010
post 30.12.2007, 22:23:58
Post #1





Grupa: Zarejestrowani
Postów: 749
Pomógł: 37
Dołączył: 3.10.2006

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


gdy przesyłam przez curl to gubi on znak plusu (+)... gdy na stronie przez formularz wklejam plus to nie ma problemu... ale jak przez curl go przesylam to robi sie problem... dlaczego?


--------------------
Go to the top of the page
+Quote Post
eai
post 30.12.2007, 22:43:07
Post #2





Grupa: Zarejestrowani
Postów: 367
Pomógł: 10
Dołączył: 20.05.2005

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


Jeśli + wstawiasz do adresu URL użyj: http://pl.php.net/manual/pl/function.urlencode.php

Czyli twój plus + będzie znakiem %2B

  1. <?php
  2. // Zamiast
  3. curl_setopt($curl, CURLOPT_POSTFIELDS,'name=alex&year=+');
  4.  
  5. //Powinno być:
  6. curl_setopt($curl, CURLOPT_POSTFIELDS,'name=alex&year=' . urlencode('+'));
  7. ?>


Ten post edytował eai 30.12.2007, 22:46:47
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 Wersja Lo-Fi Aktualny czas: 31.07.2025 - 08:00