Importing variable into URL [PHP]

Soldato
Joined
25 Oct 2006
Posts
5,395
Say I have a variable named $variable how can I import it into a URL link e.g. www.site.com/$variable

I tried with this but got an error.

PHP:
<body>
<?php 
$variable = "mypage.html";

<iframe width=100% height=100% scrolling=no style="border:0" src="http://site.com/$variable"></iframe> <br /> 

?> 

</body>

Error I got:
Code:
Parse error: syntax error, unexpected '<' in /home/lethal/public_html/mibbit.php on line 12

I'm new to PHP and have barely any experience with it, I guess this is probably quite simple.

Thanks for any help :)
 
Ok I tried with this but still got the error.
PHP:
<body>
<?php 
$variable = "mypage.php";

echo <iframe width=100% height=100% scrolling=no style="border:0" src="http://www.site.com/$variable"></iframe> <br /> ;

?> 

</body>
 
Back
Top Bottom