I downloaded MyTube script from <URL REMOVED> and installed it on my site <URL REMOVED>
That script can search and download youtube videos.
Now I have a problem, when I enter a search query with more than one word (eg: Red Rose) it gives an error, see >> <URL REMOVED>
But if I enter single query (single word) >> "Rose" >> <URL REMOVED> it woking fine.
Why is that ? can anyone help me to fix this problem, you can download that simple script from <URL REMOVED>
Last edited by Jordan; 07-07-2009 at 05:27 AM.
You'll have to provide us with the code. Especially the code on and around line 20 of base.php.
As i'm new to this forum, forum doesnot allow me to post links.
You can get the PHP code of "base.php" via below URL (As a txt file).
Pls delete unneccessary spaces in the below URL.
<URL REMOVED>
Last edited by Jordan; 07-07-2009 at 05:27 AM. Reason: URL
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:
I suspect it is something to do with the $ytsearch variable. It may have something to do with your formatting: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));
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.Code:$searchterms = addslashes(trim(str_replace(" ","+",$_GET['search'])));
$searchterms = addslashes(trim(str_replace("-","+",$_GET['search'])));
$searchterms2 = ucwords(str_replace("+"," ",$searchterms));
Thank you for replying, but i'm not a hard coder.
if you can pls download the original source code given below and fix the problem and tell it to me, and it has only few PHP file No Database required, only few PHP files.
Here is the download location of my original source code:
<URL REMOVED>
Last edited by Jordan; 07-07-2009 at 05:28 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks