Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

PHP file_get_contents()

[es] :: PHP :: PHP file_get_contents()

[ Pregleda: 2639 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

anon334571

Član broj: 334571
Poruke: 228
*.dynamic.vipmobile.rs.



+37 Profil

icon PHP file_get_contents()06.04.2018. u 09:24 - pre 72 meseci
Code:

<?php

$file = file_get_contents('https://distrowatch.com/text/phr-26');
echo $file;

?>


Na localhostu mi radi ovo, a na serveru neće. Naravno, to je samo proba, ima tu još separacija... Šta može biti?
 
Odgovor na temu

Tpojka
Ratio, Logic

Član broj: 60114
Poruke: 209

ICQ: 491318095


+33 Profil

icon Re: PHP file_get_contents()06.04.2018. u 09:52 - pre 72 meseci
Radi taj kod.
Šta znači "a na serveru neće"? Koja greška se ispisuje, šta se dešava?
-A Tpojke su Đuro - šta?
-Osnovne jedinice diverzantskih grupa!
 
Odgovor na temu

gost12
Developer

Član broj: 333123
Poruke: 37
212.92.194.*



+30 Profil

icon Re: PHP file_get_contents()06.04.2018. u 10:24 - pre 72 meseci
Vrlo vjerojatno je ta funkcija disable-ana. Lupi phpinfo() na serveru pa vidi ako ćeš nešto naći...
 
Odgovor na temu

anon334571

Član broj: 334571
Poruke: 228
*.dynamic.vipmobile.rs.



+37 Profil

icon Re: PHP file_get_contents()06.04.2018. u 10:57 - pre 72 meseci
Isključio sam prikazivanje grešaka, sad ću da probam. Jednostavno, treba da ispiše stranicu na jednom mestu a na serveru na tom mestu je praznina, nema nikakva informacija. Sad cu da vidim gresku.
 
Odgovor na temu

anon334571

Član broj: 334571
Poruke: 228
*.dynamic.vipmobile.rs.



+37 Profil

icon Re: PHP file_get_contents()06.04.2018. u 10:59 - pre 72 meseci
Upravo ovo što je gost12 rekao, isključili su tu funkciju :)

Code:

Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/skupraor/public_html/engine/inc/distrowatch.inc.php on line 3

Warning: file_get_contents(https://distrowatch.com/text/phr-26): failed to open stream: no suitable wrapper could be found in /home/skupraor/public_html/engine/inc/distrowatch.inc.php on line 3


Znači da čekam admina ?
 
Odgovor na temu

Tpojka
Ratio, Logic

Član broj: 60114
Poruke: 209

ICQ: 491318095


+33 Profil

icon Re: PHP file_get_contents()06.04.2018. u 11:14 - pre 72 meseci
Ili to, ili pokušaj sa cURL funckcijom:

Code (php):

// nešto poput ovog
function file_get_contents_curl($url) {
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);      

    $data = curl_exec($ch);
    curl_close($ch);

    return $data;
}
 

Credits.
-A Tpojke su Đuro - šta?
-Osnovne jedinice diverzantskih grupa!
 
Odgovor na temu

anon334571

Član broj: 334571
Poruke: 228
*.dynamic.vipmobile.rs.



+37 Profil

icon Re: PHP file_get_contents()06.04.2018. u 11:32 - pre 72 meseci
@Tpojka, mnogo si mi pomogao. Ovo tvoje radi poso.
 
Odgovor na temu

[es] :: PHP :: PHP file_get_contents()

[ Pregleda: 2639 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.