0

Currently I am getting

Parse error: syntax error, unexpected ''&i='' (T_CONSTANT_ENCAPSED_STRING) in /home/some/thing/index.php on line 45

which is the line below:

$content = '<iframe width="100%" height="70" frameborder="no" scrolling="no" src="http://example.com/player/audio.php?mp3=http://www.example.com/mp3embed-'.$secret.'.mp3''&i='.$row['image'].'&s='.$songz.'&a='.$artistz.'"></iframe>';    

I am not completely sure what I am doing wrong here but I feel like what ever it is sort of indicates that i'm a goofy goober.

chris85
  • 23,846
  • 7
  • 34
  • 51
Ritzy
  • 379
  • 1
  • 10
  • 1
    `.mp3''&i` should be `.mp3&i`, can't have quotes like that. – Chris Trudeau Jan 09 '16 at 20:13
  • You could use double quotes for the string encapsulation and then single quotes for the HTML attribute encapsulation. This way you won't need the concatenation because the variables can be in the double quotes. – chris85 Jan 09 '16 at 20:20

2 Answers2

1

Change:

$content = '<iframe width="100%" height="70" frameborder="no" scrolling="no" src="http://example.com/player/audio.php?mp3=http://www.example.com/mp3embed-'.$secret.'.mp3''&i='.$row['image'].'&s='.$songz.'&a='.$artistz.'"></iframe>';  

To:

$content = '<iframe width="100%" height="70" frameborder="no" scrolling="no" src="http://example.com/player/audio.php?mp3=http://www.example.com/mp3embed-'.$secret.'.mp3&i='.$row['image'].'&s='.$songz.'&a='.$artistz.'"></iframe>'; 

You can't just end and start a string like that without some sort of concatenation in between.

Chris Trudeau
  • 1,427
  • 3
  • 16
  • 20
0

Ty changing

$content = '<iframe width="100%" height="70" frameborder="no" scrolling="no" src="http://example.com/player/audio.php?mp3=http://www.example.com/mp3embed-'.$secret.'.mp3''&i='.$row['image'].'&s='.$songz.'&a='.$artistz.'"></iframe>';

to

$content = '<iframe width="100%" height="70" frameborder="no" scrolling="no" src="http://example.com/player/audio.php?mp3=http://www.example.com/mp3embed-'.$secret.'.mp3&i='.$row['image'].'&s='.$songz.'&a='.$artistz.'"></iframe>';
clean_coding
  • 1,156
  • 1
  • 9
  • 14