php Get function toto simple html code?

el1986

New member
You're including HTML inside the php (<?php ?>) tags. Any HTML needs to be outside the tags or echoed inside.

*EDIT*

You still need to echo your PHP var for it to evaluate inside the html. For instance, use short tags for this:

<param name="movie" value="games/<? echo $game; ?>.swf">
 
Hey all,

i am trying to get php get to bring a game number to a html code wich will display a flash game however obviously there are errors and i am a little confuzzled! any ideas on how to edit the code and make it work?

*code*

<?php
$game = $_GET['gameid'];
<object width="500" height="300">
<param name="movie" value="games/'$game'.swf">
<embed src="games/'$game'.swf" width="480" height="300">
</embed>
</object>

?>

*code*

The game ID is brought as /game.php?gameid=001

except i get an error which says check line 27 (the one with Value="games.........")

Many Thanks!
Thanks el1986!

now i get a white box but the game does not load...

below is the new code:

<?php
$game = $_GET['gameid'];
?>
<object width="500" height="300">
<param name="movie" value="games/'$game'.swf">
<embed src="games/'$game'.swf" width="480" height="300">
</embed>
</object>

Thanks again :D
 
Back
Top