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
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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.