Solved

Why this PHP code is not working?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
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 …

808 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