PHP Curl - Post ID 272909

User 138572 Photo

Registered User
5 posts

i tried to use a Curl script with the HTML element, but its not working, my provider sayes both PHP and Curl is supported.
I have change the adress to myradiostream.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$data = curl_exec($ch);
$data = str_replace('</body></html>', "", $data);
$split = explode(',', $data);
if (empty($split[6])) {
$title = "The current song is not available ";
} else {
$count = count($split);
$i = "6";
while($i<=$count) {
if ($i > 6) {
$title .= "," . $split[$i];
} else {
$title .= $split[$i];
$title = substr($title, 0, -1);
echo $title;
User 187934 Photo

Senior Advisor
18,233 posts

Hi Einar,
What type of errors are you seeing?
Do you have your server setup to parse php within html?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
Here's my CoffeeCup SCCP Shop with examples of what can be done.
This is a site I built for my work.(RSD)
This is a site I built for use in my job.(HTML Editor)
This is my personnel site used for testing and as an easy way to share photos.(RLM imported to RSD)

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.