Solved

Why this PHP code is not working?

Posted on 2011-02-16
3
222 Views
Last Modified: 2012-05-11
Can anyone tell me why this PHP code is not working?

<?PHP
$play = "filename.mp3";
?>
<embed src="<?php echo $play ?>" id="id_geonews" type="application/x-mplayer2" stretchtofit="true" bgcolor="#000000" url="<?php echo $play ?>" name="geonews" height="64" width="220"></td>


Without PHP code is working:
<embed src="filename.mp3" id="id_geonews" type="application/x-mplayer2" stretchtofit="true" bgcolor="#000000" url="filename.mp3" name="geonews" height="64" width="220"></td>
0
Comment
Question by:shahzad198509
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
Dzynit earned 250 total points
ID: 34910120
You're missing the semicolon after $play.
Try this code once:
<embed src="<?php echo $play; ?>" id="id_geonews" type="application/x-mplayer2" stretchtofit="true" bgcolor="#000000" url="<?php echo $play; ?>" name="geonews" height="64" width="220"></td>

Open in new window

0
 
LVL 3

Assisted Solution

by:dtocci
dtocci earned 250 total points
ID: 34910220
Or you can simplify the code like this:
<?PHP
$play = "filename.mp3";
?>
<embed src="<?=$play?>" id="id_geonews" type="application/x-mplayer2" stretchtofit="true" bgcolor="#000000" url="<?=$play?>" name="geonews" height="64" width="220"></td>
0
 

Author Comment

by:shahzad198509
ID: 34910264
Problems is solved. Thanks for help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question