It has been 3 days since I trying to learn about PHP.
I sleep for 3 hours only a day, I can't sleep till I realizing it.
I absolutely don't know PHP but I want to realized this code.
hopefully there someone who can help me so I can sleep tight tonight.
this is my big problem:
I want to extract the 4shared xml search result into php.
there is no result yet for it.
I try to implement code for showing result using foreach, but still error.
I hope you can help me.
Thanks!
I sleep for 3 hours only a day, I can't sleep till I realizing it.
I absolutely don't know PHP but I want to realized this code.
hopefully there someone who can help me so I can sleep tight tonight.
this is my big problem:
Code:
<?php
$request_url = "http://search.4shared.com/network/searchXml.jsp?q='.urlencode($termstring).'&searchExtention=mp3&sortType=1&sortOrder=1&searchmode=3&start=1";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5)');
$data = curl_exec($ch);
curl_close($ch);
$xml = SimpleXMLElement($data);
$name = $xml->getElementsByTagName('name')->item(0)->nodeValue;
$date = $xml->getElementsByTagName('upload-date')->item(0)->nodeValue;
$altr = $xml->getElementsByTagName('url')->item(0)->nodeValue;
$donlod = $xml->getElementsByTagName('flash-preview-url')->item(0)->nodeValue;
$ukrn = $xml->getElementsByTagName('size')->item(0)->nodeValue;
$oleh = $xml->getElementsByTagName('user')->item(0)->nodeValue;
?>
there is no result yet for it.
I try to implement code for showing result using foreach, but still error.
I hope you can help me.
Thanks!



Comment