Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

2 Stron V   1 2 >  
Reply to this topicStart new topic
> Curl i mały problem
b0l023
post
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


Witajcie!,
mam problem mianowicie piszę skrypt który będzie ściągał pliki z hostingów premium, lecz nie wiem jak załadować tej treści do zmiennej.

(IMG:http://i44.tinypic.com/2zsu3qc.png)


Z góry dziękuje.
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Jakiej tresci nie wiesz jak zaladowac do zmiennej? Wynik curl mozesz zapisac do zmiennej. O to ci chodzi?
Go to the top of the page
+Quote Post
phpion
post
Post #3





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




curl_setopt CURLOPT_RETURNTRANSFER
Go to the top of the page
+Quote Post
b0l023
post
Post #4





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


Nastawiałem na true oraz false, ale i tak nie pobiera.
Go to the top of the page
+Quote Post
nospor
post
Post #5





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Widac cos zrobiles źle.... skad mamy wiedziec.... wrozek nie ma..... pokaz kod, to chyba logiczne?
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




1)Juz ci powiedziano: RETURNTRANSFER ma byc na true.
2) Po czym stwierdzasz ze nie zapisalo ci do zmiennej? Nigdzie nie widze, bys to sprawdzal
Go to the top of the page
+Quote Post
b0l023
post
Post #7





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


Returntransfer bylo ustawiane na true, co do zmiennej to nie wiem właśnie co mam przypisać. W czym mieści się ten tekst?
Go to the top of the page
+Quote Post
nospor
post
Post #8





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




$exec = curl_exec($login);
Tu masz przypisanie do zmiennej...
Robisz var_dump i widzisz co tam masz:

$exec = curl_exec($login);
var_dump($exec);
Go to the top of the page
+Quote Post
b0l023
post
Post #9





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


Dziękuję za odpowiedź. Temat do zamknięcia. Pozdrawiam.
Go to the top of the page
+Quote Post
nospor
post
Post #10





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




A na przyszlosc korzystaj z manuala.... po to go wymyslono :/

http://pl1.php.net/manual/en/function.curl-setopt.php
Cytat
CURLOPT_RETURNTRANSFER TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.
Go to the top of the page
+Quote Post
b0l023
post
Post #11





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


Faktycznie pisało jak byk, ale po wpisaniu

  1.  
  2. print_r(var_dump($exec));


Wyskakuje "string(448)" i nie wyświetla nic poza tym.
Proszę cię o podpowiedź i nie zawracam Ci już głowy.
Go to the top of the page
+Quote Post
nospor
post
Post #12





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Napisalem wyraznie:
var_dump($exec);

a nie jakies
print_r(var_dump($exec));
Go to the top of the page
+Quote Post
b0l023
post
Post #13





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


Ale po wpisaniu tego wyskakuje to samo.
Go to the top of the page
+Quote Post
nospor
post
Post #14





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Skoro nie widzisz nic wiecej to albo masz tam biale znaki, albo jakies znaczniki, ktorych nie interpretuje przegladarka. Zobacz zrodlo strony w przegladarce (zazwyczaj jest to CTRL + U) i bedziesz wszystko widzial jak na dloni
Go to the top of the page
+Quote Post
b0l023
post
Post #15





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


  1. string(448) "HTTP/1.1 302 Moved Temporarily
  2. Server: nginx
  3. Date: Thu, 23 Jan 2014 09:09:42 GMT
  4. Content-Type: text/html; charset=UTF-8
  5. Connection: keep-alive
  6. X-Powered-By: PHP/5.4.17-1~dotdeb.1
  7. Expires: Thu, 19 Nov 1981 08:52:00 GMT
  8. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  9. Pragma: no-cache
  10. Location: <a href="http://h57.egofiles.com/dl/cf53455e893ea307212a310daac409d233c96af1e8d681ac615b0f489066323b/wofl.of.wall.ost.rar" target="_blank">http://h57.egofiles.com/dl/cf53455e893ea30...of.wall.ost.rar</a>
  11.  
  12. "
Go to the top of the page
+Quote Post
nospor
post
Post #16





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




No, czyli masz wszystko co chciales.
Go to the top of the page
+Quote Post
b0l023
post
Post #17





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


A jak można wyłączyć treść która jest wyświetlana w przeglądarce?.

  1. "HTTP/1.1 302 Moved Temporarily Server: nginx Date: Thu, 23 Jan 2014 14:58:39 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive X-Powered-By: PHP/5.3.21-1~dotdeb.0 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: <a href="http://h142.egofiles.com/dl/4df3f" target="_blank">http://h142.egofiles.com/dl/4df3f</a>


Wiem, że mogę ustawić CURLOPT_HEADER na false, ale wtedy skrypt nie będzie dobrze działał.
Go to the top of the page
+Quote Post
nospor
post
Post #18





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Nie bardzo rozumiem o co ci chodzi. Nie chcesz wyswietlac to nie wyswietlaj
Go to the top of the page
+Quote Post
b0l023
post
Post #19





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 22.01.2014

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


Ale ta treść sama się wyświetla a nie wiem jak ją wyłączyć.
Go to the top of the page
+Quote Post
Turson
post
Post #20





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Wywal var_dump()
Go to the top of the page
+Quote Post

2 Stron V   1 2 >
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: 6.10.2025 - 14:22