Solved

Why this PHP code is not working?

Posted on 2011-02-16
3
212 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
3 Comments
 
LVL 14

Accepted Solution

by:
Dzynit earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Problems is solved. Thanks for help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now