Solved

Why this PHP code is not working?

Posted on 2011-02-16
3
223 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

Industry Leaders: 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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

739 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