-1

I've a very simple question: trying to get the result of xml in to the header location, but I'm getting error:

Parse error: syntax error, unexpected ';' I also found the the link there explain how to solve the problem, syntax error,

I coulden't get any help from there

Here is my code:

   <?php
$xml=simplexml_load_file("http://test.com/music.xml?id=55571") or die("Error: Cannot create object");
//echo $xml->item['mp3'];
header("Location: ".$xml->item['mp3']; ?>

I'm not getting any respons in header loc, just error :( when I'm echoing it's working good.

Please help me out :)

Amir
  • 5
  • 3

2 Answers2

1

You forgot to close header ")" missing

Your Code

<?php
$xml=simplexml_load_file("http://cdn.biatik.com/api/android/2/music.xml?id=55571") or die("Error: Cannot create object");
header("Location: ".$xml->item['mp3']; ?>

MY Code

header("Location: ".$xml->item['mp3'] ); 
Maulik
  • 104
  • 7
1

Maybe just Small Typo?

header("Location: ".$xml->item['mp3']);
Bits Please
  • 877
  • 6
  • 23