Jump to content

Am Getting this foreach () Error In My Youtube Grabber [Please Help]


Recommended Posts

Hello everyone!


Am having problem with the youtube grabber I uploaded in my site. The first time I uploaded it on my host it worked well but later stopped. All I see is


Warning: Invalid argument supplied for foreach() in.... on line 13


but later it disappeared and started working well yesterday night the grabber didn't work at all, when am about to make this post I wish to post the screenshort but going to my site to screenshort it I found out that the grabber has started working normal again. Am tired of all this partial contact in the please because I know that very soon it will stop again.


Here is the php script of homepage that it do occur

    include "conf.php";
    include "header.php";
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    foreach($fetch_data as $vid){
        $date=date("jS, F Y", $time);
                <div class="v-item">
                    <div class="pplay">
                        <a href="'.$base.'/view/'.$vidId.'.html"><span class="fa fa-play"></span></a>
                    <img src="'.$thumb_uri.'">
                    <a href="'.$base.'/view/'.$vidId.'.html">'.$title.'</a>
                    <div class="time-in"><span class="fa fa-clock-o"></span> '.$date.'</div>
    <div class="w3-row v-cont" id="fsts">
        <div class="w3-row w3-padding w3-margin">
            <div class="w3-left">
                <h1>Newest Videos</h1>
<?php include "footer.php"; ?>
Edited by Stancobridge
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...