The first thing you should do is change error_reporting(0) to error_reporting(E_ALL) while debugging this script. I wrote a tutorial on debugging with PHP here, if you are interested.
Secondly, the code throwing the error is here:
Code:
$ytdata = fetchrss("http://gdata.youtube.com/feeds/videos?vq=$ytsearch&start-index=1&max-results=50");
if(!(xml_parse($ytxml_parser, $ytdata)))
die("Error on line " . xml_get_current_line_number($ytxml_parser));
I suspect it is something to do with the $ytsearch variable. It may have something to do with your formatting:
Code:
$searchterms = addslashes(trim(str_replace(" ","+",$_GET['search'])));
$searchterms = addslashes(trim(str_replace("-","+",$_GET['search'])));
$searchterms2 = ucwords(str_replace("+"," ",$searchterms));
You should echo out $ytsearch before you use it to build the URL string and see what it looks like. Or better, echo the URL string out and see if you can access it in your browser.
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum