Jump to content

[SOLVED] Get PHP to output this line:


eddy556

Recommended Posts

Hi, I'm writing a PHP application which deals with mp3 files and uses a bit of javascript.  However I cannot get PHP to output this following line correctly without errors:

 

<a href="embed.php?mp3=<?php echo $filename ?>" onClick="return popup(this, 'notes')"><img src="stream.gif" alt="Stream this song" width="14" height="14" border="0"></a>

 

At the moment I close PHP ?> put this line in and open PHP again <?PHP

 

Please can you post a PHP line to output the above?  Thanks :-)

Link to comment
https://forums.phpfreaks.com/topic/65033-solved-get-php-to-output-this-line/
Share on other sites

OKay wel when I had the code:

 

<a href="embed.php?mp3=<?php echo $filename ?>" onClick="return popup(this, 'notes')"><img src="stream.gif" alt="Stream this song" width="14" height="14" border="0">

 

 

$filename works and I also call it from other places and that works fine so I can deduce that $filename works correctly and is populated with the right data.  What other code are you wanting?  The whole script is 71 lines.  Should I post the lot?

try adding the ; after filename

 

<a href="embed.php?mp3=<?php echo $filename; ?>" onClick="return popup(this, 'notes')"><img src="stream.gif" alt="Stream this song" width="14" height="14" border="0">

 

Hope that helps

 

~ Chocopi

Just solved it...I'm dumb lol

 

echo "<a href='embed.php?mp3='$filename' onClick='return popup(this, \"notes\")'><img src='stream.gif' alt='Stream this song' width='14' height='14' border='0'></a>";   

 

I had an extra ' just before $filename when I needed to remove this as I had already opened a ' just before embed.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.