Html src = a php variable -


hello looked around bit solution couldn't find exact problem me. have php variable url. want add new iframe url.

this have, because html using double quotes after src php variable ignored.

<iframe width="420" height="345"src= "<?php $output ?>"> </iframe> 

thank guys

<iframe width="420" height="345" src="<?php echo htmlspecialchars($output); ?>"> </iframe> 

you're missing echo. also, use htmlspecialchars() ensure creating valid html isn't vulnerable injection. if find doing lot, consider using template engine.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -