PHP in HTML help

stan77

New Member
Messages
1
Reaction score
0
Points
0
I'm trying to embed flash into a webpage. No problem there. But for the source I want to have a variable from php or something else. So far I have:

<?php
$source ='http://www.somethingsomething.com';
?>

<embed src="<?php $source ?>"></embed>


But when I put that in the html editor it screws it up. Could anyone help?
 
Last edited:

Mr. DOS

Member
Messages
230
Reaction score
5
Points
18
To write the URL into the HTML, you need to do this:
PHP:
<embed src="<?php echo($source); ?>"></embed>

--- Mr. DOS
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
To output something in php, you need to use either the echo construct or the print function. They are basically the same.

Also, when putting code on the forums, use the [noparse]
Code:
,
HTML:
,
PHP:
[/noparse] tags to properly display and format the code you post.
 
Last edited:
Top