Youtube videó lekérdezés
Sziasztok!
Az lenne a kérdésem, hogy videót kérdezek le youtube-ról, ez sikerült is, de amikor feltöltöm a tárhelyre akkor hibát ír ki.
Itt a hiba :
Itt a kód:Mi lehet a hibája?
Válaszokat előre is köszönöm!
■ Az lenne a kérdésem, hogy videót kérdezek le youtube-ról, ez sikerült is, de amikor feltöltöm a tárhelyre akkor hibát ír ki.
Itt a hiba :
Warning: simplexml_load_file() [function.simplexml-load-file]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /users/minibig15blog/www/inc/Szefi91.php on line 6
Warning: simplexml_load_file(http://gdata.youtube.com/feeds/api/users/szefi91/uploads?max-results=25) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /users/minibig15blog/www/inc/Szefi91.php on line 6
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/users/szefi91/uploads?max-results=25" in /users/minibig15blog/www/inc/Szefi91.php on line 6
Warning: Invalid argument supplied for foreach() in /users/minibig15blog/www/inc/Szefi91.php on line 9
Warning: simplexml_load_file(http://gdata.youtube.com/feeds/api/users/szefi91/uploads?max-results=25) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /users/minibig15blog/www/inc/Szefi91.php on line 6
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/users/szefi91/uploads?max-results=25" in /users/minibig15blog/www/inc/Szefi91.php on line 6
Warning: Invalid argument supplied for foreach() in /users/minibig15blog/www/inc/Szefi91.php on line 9
Itt a kód:
- <?php
- $feedURL = 'http://gdata.youtube.com/feeds/api/users/szefi91/uploads?max-results=25';
- $sxml = simplexml_load_file($feedURL);
- $i=0;
- foreach ($sxml->entry as $entry) {
- $media = $entry->children('media', true);
- $watch = (string)$media->group->player->attributes()->url;
- $thumbnail = (string)$media->group->thumbnail[0]->attributes()->url;
- ?>
- <div class="videoitem">
- <div class="videothumb"><a href="<?php echo $watch; ?>" class="watchvideo" target="_blank"><img src="<?php echo $thumbnail;?>" title="<?php echo $media->group->title; ?>" /></a></div>
- <div class="videotitle">
- <p><a href="<?php echo $watch; ?>" class="watchvideo" target="_blank"><?php echo $media->group->title; ?></a></p>
- </div>
- </div>
- <?php $i++; if($i==3) { echo '<div class="clear small_v_margin"></div>'; $i=0; } } ?>
Válaszokat előre is köszönöm!
Nincs bekapcsolva a
Igen, és ezt az
RTFM
RTFM ? Ez nem tudom mi. Bocsi
Sok mindent meg lehet találni
Ezt úgy szokták mondani, hogy a "google a barátod"
A PHP-ről ráadásul sok netes kézikönyv van, magyarul is, illik ott is megnézni, a google találatok egyrésze ráadásul pont odavisz.
Az RTFM-et is meg lehet találni így.
:-)
Most néztem meg a php.ini
Most néztem meg a php.ini
Azon a tárhelyen, ahol az alkalmazást futtatod?
Ott ki van kapcsolva, most
ini_set?
Akkor nem írta volna
Próbáld meg a távoli fájlt először változóba olvasni, abból pedig majd a
simplexml_load_string
függvénnyel. Így elszeparálod azt a részt, ami a távoli nyitás. Könnyebb behatárolni így a hibát.